001
002
003
004
005
006
007
008
009
010
011
012
013
014 #include "OverlayValidation/Validate_PixelAlg.h"
015
016 #include "TH2D.h"
017
018 #include "InDetReadoutGeometry/PixelDetectorManager.h"
019 #include "InDetRawData/PixelRDO_Container.h"
020 #include "InDetIdentifier/PixelID.h"
021
022
023 #include <iostream>
024 #include <sstream>
025 #include <fstream>
026
027
028
029
030
031 Validate_PixelAlg::Validate_PixelAlg(const std::string& name, ISvcLocator* pSvcLocator)
032 : Validate_BaseAlg(name, pSvcLocator)
033 {
034
035
036 declareProperty("PIX_RDOName", m_Pixel_RDOName = "PixelRDOs");
037 }
038
039
040
041
042 Validate_PixelAlg::~Validate_PixelAlg() { }
043
044
045
046
047
048 StatusCode Validate_PixelAlg::fillHistograms() {
049
050 MsgStream log(msgSvc(), name());
051 log << MSG::DEBUG << "Entering " << name() <<"::fillHistograms()" << endreq;
052 StatusCode sc;
053
054
055
056 sc = m_detStore->retrieve(m_pixelID,"PixelID");
057 if (sc.isFailure()) {
058 log << MSG::ERROR << "Could not get PixelID helper !" << endreq;
059 return StatusCode::SUCCESS;
060 }
061 else {
062 log << MSG::DEBUG << " Found the PixelID helper. " << endreq;
063 }
064
065
066
067 log << MSG::DEBUG << "Now trying to grab the Pixel RDO Container" << endreq;
068 const DataHandle<PixelRDO_Container> p_rdocontainer;
069 if(m_storeGate->contains<PixelRDO_Container>(m_Pixel_RDOName)) {
070 sc=m_storeGate->retrieve(p_rdocontainer,m_Pixel_RDOName);
071 if (sc.isFailure() || !p_rdocontainer) {
072 log << MSG::ERROR << "Could not find the data object " << m_Pixel_RDOName << " !" << endreq;
073 return StatusCode::SUCCESS;
074 } else {
075 log << MSG::DEBUG << "Pixel RDO Container found" << endreq;
076 }
077
078
079 PixelRDO_Container::const_iterator colNext = p_rdocontainer->begin();
080 PixelRDO_Container::const_iterator lastCol = p_rdocontainer->end();
081 DataVector<PixelRDORawData>::const_iterator p_rdo;
082
083 for (; colNext != lastCol; ++colNext) {
084 const InDetRawDataCollection<PixelRDORawData>* PixelCollection(*colNext);
085 if (!PixelCollection) continue;
086 for(p_rdo=PixelCollection->begin(); p_rdo!=PixelCollection->end(); ++p_rdo) {
087 Identifier rdoID= (*p_rdo)->identify();
088 if(!m_pixelID->is_indet(rdoID)){
089 log<<MSG::WARNING<<"Found non inner detector ID in pixel container"<<endreq;
090 }
091 if(!m_pixelID->is_pixel(rdoID)){
092 log<<MSG::WARNING<<"Found non-pixel ID in pixel container"<<endreq;
093 }
094 if(m_pixelID->is_barrel(rdoID)){
095 h_ba_eta_occupancy[m_pixelID->layer_disk(rdoID)]->Fill(m_pixelID->eta_module(rdoID));
096 h_ba_phi_occupancy[m_pixelID->layer_disk(rdoID)]->Fill(m_pixelID->phi_module(rdoID));
097 h_bar_occupancy[m_pixelID->layer_disk(rdoID)]->Fill(m_pixelID->eta_module(rdoID),m_pixelID->phi_module(rdoID));
098 } else {
099 if(m_pixelID->barrel_ec(rdoID)<0){
100 h_ecNeg_phi_occupancy[m_pixelID->layer_disk(rdoID)]->Fill(m_pixelID->phi_module(rdoID));
101 h_ecNeg_occupancy->Fill(m_pixelID->layer_disk(rdoID),m_pixelID->phi_module(rdoID));
102 } else {
103 h_ecPos_phi_occupancy[m_pixelID->layer_disk(rdoID)]->Fill(m_pixelID->phi_module(rdoID));
104 h_ecPos_occupancy->Fill(m_pixelID->layer_disk(rdoID),m_pixelID->phi_module(rdoID));
105 }
106 }
107 }
108 }
109 }
110 return StatusCode::SUCCESS;
111 }
112
113
114
115
116
117
118
119
120
121 StatusCode Validate_PixelAlg::bookHistograms() {
122
123 StatusCode sc;
124 MsgStream mLog(messageService(), name());
125 mLog << MSG::DEBUG << "Booking histograms" << endreq;
126
127 char name[128],title[128],regname[128];
128
129
130 for (int i=0;i<3;i++){
131 sprintf(name,"pixel_ec_%dneg_phi_occupancy",i);
132 sprintf(title,"EC %d negative side iphi occupance",i);
133 h_ecNeg_phi_occupancy[i] = new TH1D(name,title,48,-.5,47.5);
134 sprintf(regname,"/AANT/Pixel/ec%dnegPhi_occ",i);
135 sc = m_thistSvc->regHist(regname,h_ecNeg_phi_occupancy[i]);
136
137 sprintf(name,"pixel_ec_%dpos_phi_occupancy",i);
138 sprintf(title,"EC %d positive side iphi occupance",i);
139 h_ecPos_phi_occupancy[i] = new TH1D(name,title,48,-.5,47.5);
140 sprintf(regname,"/AANT/Pixel/ec%dposPhi_occ",i);
141 sc = m_thistSvc->regHist(regname,h_ecPos_phi_occupancy[i]);
142 }
143
144
145
146 h_ba_eta_occupancy[0] = new TH1D("pixel_ba_0_eta_occupancy","Pixel Barrel layer 0 ieta occupancy",13,-6.5,6.5);
147 sc = m_thistSvc->regHist("/AANT/Pixel/lay0_bar_eta_occ",h_ba_eta_occupancy[0]);
148 h_ba_eta_occupancy[1] = new TH1D("pixel_ba_1_eta_occupancy","Pixel Barrel layer 1 ieta occupancy",13,-6.5,6.5);
149 sc = m_thistSvc->regHist("/AANT/Pixel/lay1_bar_eta_occ",h_ba_eta_occupancy[1]);
150 h_ba_eta_occupancy[2] = new TH1D("pixel_ba_2_eta_occupancy","Pixel Barrel layer 2 ieta occupancy",13,-6.5,6.5);
151 sc = m_thistSvc->regHist("/AANT/Pixel/lay2_bar_eta_occ",h_ba_eta_occupancy[2]);
152
153 h_ba_phi_occupancy[0] = new TH1D("pixel_ba_0_phi_occupancy","Pixel Barrel layer 0 iphi occupancy",22,-.5,21.5);
154 sc = m_thistSvc->regHist("/AANT/Pixel/lay0_bar_phi_occ",h_ba_phi_occupancy[0]);
155 h_ba_phi_occupancy[1] = new TH1D("pixel_ba_1_phi_occupancy","Pixel Barrel layer 1 iphi occupancy",38,-.5,37.5);
156 sc = m_thistSvc->regHist("/AANT/Pixel/lay1_bar_phi_occ",h_ba_phi_occupancy[1]);
157 h_ba_phi_occupancy[2] = new TH1D("pixel_ba_2_phi_occupancy","Pixel Barrel layer 2 iphi occupancy",52,-.5,51.5);
158 sc = m_thistSvc->regHist("/AANT/Pixel/lay2_bar_phi_occ",h_ba_phi_occupancy[2]);
159
160
161 h_ecNeg_occupancy = new TH2D("pixel_ECNeg_occupancy", "Pixel EC negative side occupancy", 3,0,3,48,0,48);
162 sc = m_thistSvc->regHist("/AANT/Pixel/ecNeg_occ",h_ecNeg_occupancy);
163 h_ecPos_occupancy = new TH2D("pixel_ECPos_occupancy", "Pixel EC positive side occupancy", 3,0,3,48,0,48);
164 sc = m_thistSvc->regHist("/AANT/Pixel/ecPos_occ",h_ecPos_occupancy);
165 h_bar_occupancy[0] = new TH2D("pixel_B0_occupancy", "Pixel Barrel layer 0 occupancy", 13,-6.5,6.5,22,0,22);
166 sc = m_thistSvc->regHist("/AANT/Pixel/lay0_bar_occ",h_bar_occupancy[0]);
167 h_bar_occupancy[1] = new TH2D("pixel_B1_occupancy", "Pixel Barrel layer 1 occupancy", 13,-6.5,6.5,38,0,38);
168 sc = m_thistSvc->regHist("/AANT/Pixel/lay1_bar_occ",h_bar_occupancy[1]);
169 h_bar_occupancy[2] = new TH2D("pixel_B2_occupancy", "Pixel Barrel layer 2 occupancy", 13,-6.5,6.5,52,0,52);
170 sc = m_thistSvc->regHist("/AANT/Pixel/lay2_bar_occ",h_bar_occupancy[2]);
171
172 if (sc.isFailure()) {
173 mLog << MSG::ERROR << "ROOT Hist registration failed!" << endreq;
174 return StatusCode::FAILURE;
175 }
176 return StatusCode::SUCCESS;
177
178 }
Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems |
This page was automatically generated by the
LXR engine.
|
|