38 theRecHits4DLabel_ = consumes<DTRecSegment4DCollection>(
parameters.getParameter<
std::string>(
"recHits4DLabel"));
51 theDbe->setVerbose(1);
53 theDbe->setCurrentFolder(
"Muons/DTSegmentsMonitor");
56 phiHistos.push_back(theDbe->book2D(
"phiSegments_numHitsVsWheel",
"phiSegments_numHitsVsWheel", 5, -2.5, 2.5, 20, 0, 20));
57 phiHistos[0]->setBinLabel(1,
"W-2",1);
58 phiHistos[0]->setBinLabel(2,
"W-1",1);
59 phiHistos[0]->setBinLabel(3,
"W0",1);
60 phiHistos[0]->setBinLabel(4,
"W1",1);
61 phiHistos[0]->setBinLabel(5,
"W2",1);
62 phiHistos.push_back(theDbe->book2D(
"phiSegments_numHitsVsSector",
"phiSegments_numHitsVsSector", 14, 0.5, 14.5, 20, 0, 20));
63 phiHistos[1]->setBinLabel(1,
"Sec1",1);
64 phiHistos[1]->setBinLabel(2,
"Sec2",1);
65 phiHistos[1]->setBinLabel(3,
"Sec3",1);
66 phiHistos[1]->setBinLabel(4,
"Sec4",1);
67 phiHistos[1]->setBinLabel(5,
"Sec5",1);
68 phiHistos[1]->setBinLabel(6,
"Sec6",1);
69 phiHistos[1]->setBinLabel(7,
"Sec7",1);
70 phiHistos[1]->setBinLabel(8,
"Sec8",1);
71 phiHistos[1]->setBinLabel(9,
"Sec9",1);
72 phiHistos[1]->setBinLabel(10,
"Sec10",1);
73 phiHistos[1]->setBinLabel(11,
"Sec11",1);
74 phiHistos[1]->setBinLabel(12,
"Sec12",1);
75 phiHistos[1]->setBinLabel(13,
"Sec13",1);
76 phiHistos[1]->setBinLabel(14,
"Sec14",1);
77 phiHistos.push_back(theDbe->book2D(
"phiSegments_numHitsVsStation",
"phiSegments_numHitsVsStation", 4, 0.5, 4.5, 20, 0, 20));
78 phiHistos[2]->setBinLabel(1,
"St1",1);
79 phiHistos[2]->setBinLabel(2,
"St2",1);
80 phiHistos[2]->setBinLabel(3,
"St3",1);
81 phiHistos[2]->setBinLabel(4,
"St4",1);
84 thetaHistos.push_back(theDbe->book2D(
"thetaSegments_numHitsVsWheel",
"thetaSegments_numHitsVsWheel", 5, -2.5, 2.5, 20, 0, 20));
85 thetaHistos[0]->setBinLabel(1,
"W-2",1);
86 thetaHistos[0]->setBinLabel(2,
"W-1",1);
87 thetaHistos[0]->setBinLabel(3,
"W0",1);
88 thetaHistos[0]->setBinLabel(4,
"W1",1);
89 thetaHistos[0]->setBinLabel(5,
"W2",1);
90 thetaHistos.push_back(theDbe->book2D(
"thetaSegments_numHitsVsSector",
"thetaSegments_numHitsVsSector", 14, 0.5, 14.5, 20, 0, 20));
91 thetaHistos[1]->setBinLabel(1,
"Sec1",1);
92 thetaHistos[1]->setBinLabel(2,
"Sec2",1);
93 thetaHistos[1]->setBinLabel(3,
"Sec3",1);
94 thetaHistos[1]->setBinLabel(4,
"Sec4",1);
95 thetaHistos[1]->setBinLabel(5,
"Sec5",1);
96 thetaHistos[1]->setBinLabel(6,
"Sec6",1);
97 thetaHistos[1]->setBinLabel(7,
"Sec7",1);
98 thetaHistos[1]->setBinLabel(8,
"Sec8",1);
99 thetaHistos[1]->setBinLabel(9,
"Sec9",1);
100 thetaHistos[1]->setBinLabel(10,
"Sec10",1);
101 thetaHistos[1]->setBinLabel(11,
"Sec11",1);
102 thetaHistos[1]->setBinLabel(12,
"Sec12",1);
103 thetaHistos[1]->setBinLabel(13,
"Sec13",1);
104 thetaHistos[1]->setBinLabel(14,
"Sec14",1);
105 thetaHistos.push_back(theDbe->book2D(
"thetaSegments_numHitsVsStation",
"thetaSegments_numHitsVsStation", 4, 0.5, 4.5, 20, 0, 20));
106 thetaHistos[2]->setBinLabel(1,
"St1",1);
107 thetaHistos[2]->setBinLabel(2,
"St2",1);
108 thetaHistos[2]->setBinLabel(3,
"St3",1);
109 thetaHistos[2]->setBinLabel(4,
"St4",1);
114 bool outputMEsInRootFile =
parameters.getParameter<
bool>(
"OutputMEsInRootFile");
116 if(outputMEsInRootFile){
117 theDbe->save(outputFileName);
121 bool outputMEsInRootFile =
parameters.getParameter<
bool>(
"OutputMEsInRootFile");
123 if(outputMEsInRootFile){
124 theDbe->save(outputFileName);
127 theDbe->rmdir(
"DT/DTSegmentsTask");
133 bool checkNoisyChannels =
parameters.getUntrackedParameter<
bool>(
"checkNoisyChannels",
false);
135 if(checkNoisyChannels) {
141 event.getByToken(theRecHits4DLabel_, all4DSegments);
144 DTRecSegment4DCollection::id_iterator chamberId;
145 for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId){
148 int nsegm = distance(range.first, range.second);
150 cout <<
" Chamber: " << *chamberId <<
" has " << nsegm
151 <<
" 4D segments" << endl;
157 bool segmNoisy =
false;
158 if((*segment4D).hasPhi()){
161 map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
162 for(vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
hit != phiHits.end(); ++
hit) {
166 if(checkNoisyChannels) {
167 bool isNoisy =
false;
168 bool isFEMasked =
false;
169 bool isTDCMasked =
false;
170 bool isTrigMask =
false;
173 statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
176 cout <<
"Wire: " << wireId <<
" is noisy, skipping!" << endl;
183 if((*segment4D).hasZed()) {
187 for(vector<DTRecHit1D>::const_iterator
hit = zHits.begin();
188 hit != zHits.end(); ++
hit) {
190 if(checkNoisyChannels) {
191 bool isNoisy =
false;
192 bool isFEMasked =
false;
193 bool isTDCMasked =
false;
194 bool isTrigMask =
false;
198 statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
201 cout <<
"Wire: " << wireId <<
" is noisy, skipping!" << endl;
210 cout<<
"skipping the segment: it contains noisy cells"<<endl;
217 if((*segment4D).hasPhi()){
218 nHits = (((*segment4D).phiSegment())->specificRecHits()).
size();
220 cout<<
"Phi segment with number of hits: "<<nHits<<endl;
221 phiHistos[0]->Fill((*chamberId).wheel(), nHits);
222 phiHistos[1]->Fill((*chamberId).sector(), nHits);
223 phiHistos[2]->Fill((*chamberId).station(), nHits);
225 if((*segment4D).hasZed()) {
226 nHits = (((*segment4D).zSegment())->specificRecHits()).
size();
228 cout<<
"Zed segment with number of hits: "<<nHits<<endl;
229 thetaHistos[0]->Fill((*chamberId).wheel(), nHits);
230 thetaHistos[1]->Fill((*chamberId).sector(), nHits);
231 thetaHistos[2]->Fill((*chamberId).station(), nHits);
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const_iterator, const_iterator > range
iterator range
virtual ~DTSegmentsTask()
Destructor.
void analyze(const edm::Event &event, const edm::EventSetup &setup)
DTSegmentsTask(const edm::ParameterSet &pset)
Constructor.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
void beginJob(void)
book the histos
void endRun(const edm::Run &, const edm::EventSetup &)
void beginRun(const edm::Run &, const edm::EventSetup &)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.