@@ -16,25 +16,43 @@ L1TdeCSCTPG::L1TdeCSCTPG(const edm::ParameterSet& ps)
1616
1717 // variables
1818 alctVars_(ps.getParameter<std::vector<std::string>>(" alctVars" )),
19- clctVars_(ps.getParameter<std::vector<std::string>>(" lctVars " )),
19+ clctVars_(ps.getParameter<std::vector<std::string>>(" clctVars " )),
2020 lctVars_(ps.getParameter<std::vector<std::string>>(" lctVars" )),
2121
2222 // binning
2323 alctNBin_(ps.getParameter<std::vector<unsigned >>(" alctNBin" )),
24- clctNBin_(ps.getParameter<std::vector<unsigned >>(" lctNBin " )),
24+ clctNBin_(ps.getParameter<std::vector<unsigned >>(" clctNBin " )),
2525 lctNBin_(ps.getParameter<std::vector<unsigned >>(" lctNBin" )),
2626 alctMinBin_(ps.getParameter<std::vector<double >>(" alctMinBin" )),
27- clctMinBin_(ps.getParameter<std::vector<double >>(" lctMinBin " )),
27+ clctMinBin_(ps.getParameter<std::vector<double >>(" clctMinBin " )),
2828 lctMinBin_(ps.getParameter<std::vector<double >>(" lctMinBin" )),
2929 alctMaxBin_(ps.getParameter<std::vector<double >>(" alctMaxBin" )),
30- clctMaxBin_(ps.getParameter<std::vector<double >>(" lctMaxBin" )),
31- lctMaxBin_(ps.getParameter<std::vector<double >>(" lctMaxBin" )) {}
30+ clctMaxBin_(ps.getParameter<std::vector<double >>(" clctMaxBin" )),
31+ lctMaxBin_(ps.getParameter<std::vector<double >>(" lctMaxBin" )),
32+ B904Setup_(ps.getParameter<bool >(" B904Setup" )),
33+ isRun3_(ps.getParameter<bool >(" isRun3" )) {}
3234
3335L1TdeCSCTPG::~L1TdeCSCTPG () {}
3436
3537void L1TdeCSCTPG::bookHistograms (DQMStore::IBooker& iBooker, const edm::Run&, const edm::EventSetup&) {
3638 iBooker.setCurrentFolder (monitorDir_);
3739
40+ // do not analyze Run-3 properties in Run-1 and Run-2 eras
41+ if (!isRun3_) {
42+ clctVars_.resize (4 );
43+ lctVars_.resize (5 );
44+ }
45+
46+ // remove the non-ME1/1 chambers from the list when B904Setup is set to true
47+ if (B904Setup_) {
48+ chambers_.resize (1 );
49+ }
50+ // do not analyze the 1/4-strip bit, 1/8-strip bit
51+ else {
52+ clctVars_.resize (9 );
53+ lctVars_.resize (9 );
54+ }
55+
3856 // chamber type
3957 for (unsigned iType = 0 ; iType < chambers_.size (); iType++) {
4058 // data vs emulator
@@ -46,6 +64,7 @@ void L1TdeCSCTPG::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, co
4664 const std::string histTitle (chambers_[iType] + " ALCT " + alctVars_[iVar] + " (" + dataEmul_[iData] + " ) " );
4765 chamberHistos[iType][key] =
4866 iBooker.book1D (histName, histTitle, alctNBin_[iVar], alctMinBin_[iVar], alctMaxBin_[iVar]);
67+ chamberHistos[iType][key]->getTH1 ()->SetMinimum (0 );
4968 }
5069
5170 // clct variable
@@ -55,6 +74,7 @@ void L1TdeCSCTPG::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, co
5574 const std::string histTitle (chambers_[iType] + " CLCT " + clctVars_[iVar] + " (" + dataEmul_[iData] + " ) " );
5675 chamberHistos[iType][key] =
5776 iBooker.book1D (histName, histTitle, clctNBin_[iVar], clctMinBin_[iVar], clctMaxBin_[iVar]);
77+ chamberHistos[iType][key]->getTH1 ()->SetMinimum (0 );
5878 }
5979
6080 // lct variable
@@ -64,6 +84,7 @@ void L1TdeCSCTPG::bookHistograms(DQMStore::IBooker& iBooker, const edm::Run&, co
6484 const std::string histTitle (chambers_[iType] + " LCT " + lctVars_[iVar] + " (" + dataEmul_[iData] + " ) " );
6585 chamberHistos[iType][key] =
6686 iBooker.book1D (histName, histTitle, lctNBin_[iVar], lctMinBin_[iVar], lctMaxBin_[iVar]);
87+ chamberHistos[iType][key]->getTH1 ()->SetMinimum (0 );
6788 }
6889 }
6990 }
@@ -87,67 +108,139 @@ void L1TdeCSCTPG::analyze(const edm::Event& e, const edm::EventSetup& c) {
87108
88109 for (auto it = dataALCTs->begin (); it != dataALCTs->end (); it++) {
89110 auto range = dataALCTs->get ((*it).first );
90- const int type = ((*it).first ).iChamberType () - 1 ;
111+ const int type = ((*it).first ).iChamberType () - 2 ;
112+ // ignore non-ME1/1 chambers when using B904 test-stand data
113+ if (B904Setup_ and !((*it).first ).isME11 ())
114+ continue ;
91115 for (auto alct = range.first ; alct != range.second ; alct++) {
92- chamberHistos[type][" alct_quality_data" ]->Fill (alct->getQuality ());
93- chamberHistos[type][" alct_wiregroup_data" ]->Fill (alct->getKeyWG ());
94- chamberHistos[type][" alct_bx_data" ]->Fill (alct->getBX ());
116+ if (alct->isValid ()) {
117+ chamberHistos[type][" alct_quality_data" ]->Fill (alct->getQuality ());
118+ chamberHistos[type][" alct_wiregroup_data" ]->Fill (alct->getKeyWG ());
119+ chamberHistos[type][" alct_bx_data" ]->Fill (alct->getBX ());
120+ }
95121 }
96122 }
97123
98124 for (auto it = emulALCTs->begin (); it != emulALCTs->end (); it++) {
99125 auto range = emulALCTs->get ((*it).first );
100- const int type = ((*it).first ).iChamberType () - 1 ;
126+ const int type = ((*it).first ).iChamberType () - 2 ;
127+ // ignore non-ME1/1 chambers when using B904 test-stand data
128+ if (B904Setup_ and !((*it).first ).isME11 ())
129+ continue ;
101130 for (auto alct = range.first ; alct != range.second ; alct++) {
102- chamberHistos[type][" alct_quality_emul" ]->Fill (alct->getQuality ());
103- chamberHistos[type][" alct_wiregroup_emul" ]->Fill (alct->getKeyWG ());
104- chamberHistos[type][" alct_bx_emul" ]->Fill (alct->getBX ());
131+ if (alct->isValid ()) {
132+ chamberHistos[type][" alct_quality_emul" ]->Fill (alct->getQuality ());
133+ chamberHistos[type][" alct_wiregroup_emul" ]->Fill (alct->getKeyWG ());
134+ chamberHistos[type][" alct_bx_emul" ]->Fill (alct->getBX ());
135+ }
105136 }
106137 }
107138
108139 for (auto it = dataCLCTs->begin (); it != dataCLCTs->end (); it++) {
109140 auto range = dataCLCTs->get ((*it).first );
110- const int type = ((*it).first ).iChamberType () - 1 ;
141+ const int type = ((*it).first ).iChamberType () - 2 ;
142+ // ignore non-ME1/1 chambers when using B904 test-stand data
143+ if (B904Setup_ and !((*it).first ).isME11 ())
144+ continue ;
111145 for (auto clct = range.first ; clct != range.second ; clct++) {
112- chamberHistos[type][" clct_pattern_data" ]->Fill (clct->getPattern ());
113- chamberHistos[type][" clct_quality_data" ]->Fill (clct->getQuality ());
114- chamberHistos[type][" clct_halfstrip_data" ]->Fill (clct->getKeyStrip ());
115- chamberHistos[type][" clct_bend_data" ]->Fill (clct->getBend ());
146+ if (clct->isValid ()) {
147+ chamberHistos[type][" clct_pattern_data" ]->Fill (clct->getPattern ());
148+ chamberHistos[type][" clct_quality_data" ]->Fill (clct->getQuality ());
149+ chamberHistos[type][" clct_halfstrip_data" ]->Fill (clct->getKeyStrip ());
150+ chamberHistos[type][" clct_bend_data" ]->Fill (clct->getBend ());
151+ if (isRun3_) {
152+ chamberHistos[type][" clct_run3pattern_data" ]->Fill (clct->getRun3Pattern ());
153+ chamberHistos[type][" clct_quartstrip_data" ]->Fill (clct->getKeyStrip (4 ));
154+ chamberHistos[type][" clct_eighthstrip_data" ]->Fill (clct->getKeyStrip (8 ));
155+ chamberHistos[type][" clct_slope_data" ]->Fill (clct->getSlope ());
156+ chamberHistos[type][" clct_compcode_data" ]->Fill (clct->getCompCode ());
157+ if (B904Setup_) {
158+ chamberHistos[type][" clct_quartstripbit_data" ]->Fill (clct->getQuartStripBit ());
159+ chamberHistos[type][" clct_eighthstripbit_data" ]->Fill (clct->getEighthStripBit ());
160+ }
161+ }
162+ }
116163 }
117164 }
118165
119166 for (auto it = emulCLCTs->begin (); it != emulCLCTs->end (); it++) {
120167 auto range = emulCLCTs->get ((*it).first );
121- const int type = ((*it).first ).iChamberType () - 1 ;
168+ const int type = ((*it).first ).iChamberType () - 2 ;
169+ // ignore non-ME1/1 chambers when using B904 test-stand data
170+ if (B904Setup_ and !((*it).first ).isME11 ())
171+ continue ;
122172 for (auto clct = range.first ; clct != range.second ; clct++) {
123- chamberHistos[type][" clct_pattern_emul" ]->Fill (clct->getPattern ());
124- chamberHistos[type][" clct_quality_emul" ]->Fill (clct->getQuality ());
125- chamberHistos[type][" clct_halfstrip_emul" ]->Fill (clct->getKeyStrip ());
126- chamberHistos[type][" clct_bend_emul" ]->Fill (clct->getBend ());
173+ if (clct->isValid ()) {
174+ chamberHistos[type][" clct_pattern_emul" ]->Fill (clct->getPattern ());
175+ chamberHistos[type][" clct_quality_emul" ]->Fill (clct->getQuality ());
176+ chamberHistos[type][" clct_halfstrip_emul" ]->Fill (clct->getKeyStrip ());
177+ chamberHistos[type][" clct_bend_emul" ]->Fill (clct->getBend ());
178+ if (isRun3_) {
179+ chamberHistos[type][" clct_run3pattern_emul" ]->Fill (clct->getRun3Pattern ());
180+ chamberHistos[type][" clct_quartstrip_emul" ]->Fill (clct->getKeyStrip (4 ));
181+ chamberHistos[type][" clct_eighthstrip_emul" ]->Fill (clct->getKeyStrip (8 ));
182+ chamberHistos[type][" clct_slope_emul" ]->Fill (clct->getSlope ());
183+ chamberHistos[type][" clct_compcode_emul" ]->Fill (clct->getCompCode ());
184+ if (B904Setup_) {
185+ chamberHistos[type][" clct_quartstripbit_emul" ]->Fill (clct->getQuartStripBit ());
186+ chamberHistos[type][" clct_eighthstripbit_emul" ]->Fill (clct->getEighthStripBit ());
187+ }
188+ }
189+ }
127190 }
128191 }
129192
130193 for (auto it = dataLCTs->begin (); it != dataLCTs->end (); it++) {
131194 auto range = dataLCTs->get ((*it).first );
132- const int type = ((*it).first ).iChamberType () - 1 ;
195+ const int type = ((*it).first ).iChamberType () - 2 ;
196+ // ignore non-ME1/1 chambers when using B904 test-stand data
197+ if (B904Setup_ and !((*it).first ).isME11 ())
198+ continue ;
133199 for (auto lct = range.first ; lct != range.second ; lct++) {
134- chamberHistos[type][" lct_pattern_data" ]->Fill (lct->getCLCTPattern ());
135- chamberHistos[type][" lct_quality_data" ]->Fill (lct->getQuality ());
136- chamberHistos[type][" lct_wiregroup_data" ]->Fill (lct->getKeyWG ());
137- chamberHistos[type][" lct_halfstrip_data" ]->Fill (lct->getStrip ());
138- chamberHistos[type][" lct_bend_data" ]->Fill (lct->getBend ());
200+ if (lct->isValid ()) {
201+ chamberHistos[type][" lct_pattern_data" ]->Fill (lct->getPattern ());
202+ chamberHistos[type][" lct_quality_data" ]->Fill (lct->getQuality ());
203+ chamberHistos[type][" lct_wiregroup_data" ]->Fill (lct->getKeyWG ());
204+ chamberHistos[type][" lct_halfstrip_data" ]->Fill (lct->getStrip ());
205+ chamberHistos[type][" lct_bend_data" ]->Fill (lct->getBend ());
206+ if (isRun3_) {
207+ chamberHistos[type][" lct_run3pattern_data" ]->Fill (lct->getRun3Pattern ());
208+ chamberHistos[type][" lct_slope_data" ]->Fill (lct->getSlope ());
209+ chamberHistos[type][" lct_quartstrip_data" ]->Fill (lct->getStrip (4 ));
210+ chamberHistos[type][" lct_eighthstrip_data" ]->Fill (lct->getStrip (8 ));
211+ if (B904Setup_) {
212+ chamberHistos[type][" lct_quartstripbit_data" ]->Fill (lct->getQuartStripBit ());
213+ chamberHistos[type][" lct_eighthstripbit_data" ]->Fill (lct->getEighthStripBit ());
214+ }
215+ }
216+ }
139217 }
140218 }
141219
142220 for (auto it = emulLCTs->begin (); it != emulLCTs->end (); it++) {
143221 auto range = emulLCTs->get ((*it).first );
144- const int type = ((*it).first ).iChamberType () - 1 ;
222+ const int type = ((*it).first ).iChamberType () - 2 ;
223+ // ignore non-ME1/1 chambers when using B904 test-stand data
224+ if (B904Setup_ and !((*it).first ).isME11 ())
225+ continue ;
145226 for (auto lct = range.first ; lct != range.second ; lct++) {
146- chamberHistos[type][" lct_pattern_emul" ]->Fill (lct->getCLCTPattern ());
147- chamberHistos[type][" lct_quality_emul" ]->Fill (lct->getQuality ());
148- chamberHistos[type][" lct_wiregroup_emul" ]->Fill (lct->getKeyWG ());
149- chamberHistos[type][" lct_halfstrip_emul" ]->Fill (lct->getStrip ());
150- chamberHistos[type][" lct_bend_emul" ]->Fill (lct->getBend ());
227+ if (lct->isValid ()) {
228+ chamberHistos[type][" lct_pattern_emul" ]->Fill (lct->getPattern ());
229+ chamberHistos[type][" lct_quality_emul" ]->Fill (lct->getQuality ());
230+ chamberHistos[type][" lct_wiregroup_emul" ]->Fill (lct->getKeyWG ());
231+ chamberHistos[type][" lct_halfstrip_emul" ]->Fill (lct->getStrip ());
232+ chamberHistos[type][" lct_bend_emul" ]->Fill (lct->getBend ());
233+ if (isRun3_) {
234+ chamberHistos[type][" lct_run3pattern_emul" ]->Fill (lct->getRun3Pattern ());
235+ chamberHistos[type][" lct_slope_emul" ]->Fill (lct->getSlope ());
236+ chamberHistos[type][" lct_quartstrip_emul" ]->Fill (lct->getStrip (4 ));
237+ chamberHistos[type][" lct_eighthstrip_emul" ]->Fill (lct->getStrip (8 ));
238+ if (B904Setup_) {
239+ chamberHistos[type][" lct_quartstripbit_emul" ]->Fill (lct->getQuartStripBit ());
240+ chamberHistos[type][" lct_eighthstripbit_emul" ]->Fill (lct->getEighthStripBit ());
241+ }
242+ }
243+ }
151244 }
152245 }
153246}
0 commit comments