54 file =
new TFile(
"ewq.root",
"RECREATE");
55 tree =
new TTree(
"dy",
"QWE");
56 tree->Branch(
"dtPhi_1_plus", &
dtPhi[0][0],
"dtPhi_1_plus/I");
57 tree->Branch(
"dtPhi_2_plus", &
dtPhi[1][0],
"dtPhi_2_plus/I");
58 tree->Branch(
"dtPhi_3_plus", &
dtPhi[2][0],
"dtPhi_3_plus/I");
59 tree->Branch(
"dtPhi_4_plus", &
dtPhi[3][0],
"dtPhi_4_plus/I");
60 tree->Branch(
"dtPhi_5_plus", &
dtPhi[4][0],
"dtPhi_5_plus/I");
61 tree->Branch(
"dtPhi_6_plus", &
dtPhi[5][0],
"dtPhi_6_plus/I");
62 tree->Branch(
"dtPhi_7_plus", &
dtPhi[6][0],
"dtPhi_7_plus/I");
63 tree->Branch(
"dtPhi_8_plus", &
dtPhi[7][0],
"dtPhi_8_plus/I");
64 tree->Branch(
"dtPhi_9_plus", &
dtPhi[8][0],
"dtPhi_9_plus/I");
65 tree->Branch(
"dtPhi_10_plus", &
dtPhi[9][0],
"dtPhi_10_plus/I");
66 tree->Branch(
"dtPhi_11_plus", &
dtPhi[10][0],
"dtPhi_11_plus/I");
67 tree->Branch(
"dtPhi_12_plus", &
dtPhi[11][0],
"dtPhi_12_plus/I");
68 tree->Branch(
"dtPhi_1_minus", &
dtPhi[0][1],
"dtPhi_1_minus/I");
69 tree->Branch(
"dtPhi_2_minus", &
dtPhi[1][1],
"dtPhi_2_minus/I");
70 tree->Branch(
"dtPhi_3_minus", &
dtPhi[2][1],
"dtPhi_3_minus/I");
71 tree->Branch(
"dtPhi_4_minus", &
dtPhi[3][1],
"dtPhi_4_minus/I");
72 tree->Branch(
"dtPhi_5_minus", &
dtPhi[4][1],
"dtPhi_5_minus/I");
73 tree->Branch(
"dtPhi_6_minus", &
dtPhi[5][1],
"dtPhi_6_minus/I");
74 tree->Branch(
"dtPhi_7_minus", &
dtPhi[6][1],
"dtPhi_7_minus/I");
75 tree->Branch(
"dtPhi_8_minus", &
dtPhi[7][1],
"dtPhi_8_minus/I");
76 tree->Branch(
"dtPhi_9_minus", &
dtPhi[8][1],
"dtPhi_9_minus/I");
77 tree->Branch(
"dtPhi_10_minus", &
dtPhi[9][1],
"dtPhi_10_minus/I");
78 tree->Branch(
"dtPhi_11_minus", &
dtPhi[10][1],
"dtPhi_11_minus/I");
79 tree->Branch(
"dtPhi_12_minus", &
dtPhi[11][1],
"dtPhi_12_minus/I");
106 edm::LogInfo(
"CSCTFAnalyzer") <<
" Unpacking Errors: " << status->first;
107 for (std::vector<L1CSCSPStatusDigi>::const_iterator
stat = status->second.begin();
stat != status->second.end();
112 edm::LogInfo(
"CSCTFAnalyzer") <<
" No valid L1CSCStatusDigiCollection products found";
120 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
121 std::cout <<
"DT size=" << vstubs.end() - vstubs.begin() << std::endl;
122 for (std::vector<csctf::TrackStub>::const_iterator stub = vstubs.begin(); stub != vstubs.end(); stub++) {
123 int dtSector = (stub->sector() - 1) * 2 + stub->subsector() - 1;
124 int dtEndcap = stub->endcap() - 1;
125 if (dtSector >= 0 && dtSector < 12 && dtEndcap >= 0 && dtEndcap < 2) {
126 dtPhi[dtSector][dtEndcap] = stub->phiPacked();
128 edm::LogInfo(
"CSCTFAnalyzer: DT digi are out of range: ")
129 <<
" dtSector=" << dtSector <<
" dtEndcap=" << dtEndcap;
131 edm::LogInfo(
"CSCTFAnalyzer") <<
" DT data: tbin=" << stub->BX() <<
" CSC sector=" << stub->sector()
132 <<
" CSC subsector=" << stub->subsector() <<
" station=" << stub->station()
133 <<
" endcap=" << stub->endcap() <<
" phi=" << stub->phiPacked()
134 <<
" phiBend=" << stub->getBend() <<
" quality=" << stub->getQuality()
135 <<
" mb_bxn=" << stub->cscid();
138 edm::LogInfo(
"CSCTFAnalyzer") <<
" No valid CSCTriggerContainer<csctf::TrackStub> products found";
152 int station = (*csc).first.station() - 1;
153 int cscId = (*csc).first.triggerCscId() - 1;
154 int sector = (*csc).first.triggerSector() - 1;
156 int tbin = lct->getBX();
157 int fpga = (subSector ? subSector - 1 : station + 1);
159 if (sector < 0 || sector > 11 || station < 0 || station > 3 || cscId < 0 || cscId > 8 || lctId < 0 ||
161 edm::LogInfo(
"CSCTFAnalyzer: CSC digi are out of range: ");
164 edm::LogInfo(
"CSCTFAnalyzer") <<
" Front data endcap: " << (*csc).first.endcap()
165 <<
" station: " << (station + 1) <<
" sector: " << (sector + 1)
166 <<
" subSector: " << subSector <<
" tbin: " << tbin
167 <<
" cscId: " << (cscId + 1) <<
" fpga: " << (fpga + 1) <<
" "
168 <<
"LCT(vp=" << lct->isValid() <<
",qual=" << lct->getQuality()
169 <<
",wg=" << lct->getKeyWG() <<
",strip=" << lct->getStrip()
170 <<
",link=" << lct->getMPCLink() <<
")";
174 edm::LogInfo(
"CSCTFAnalyzer") <<
" No valid CSCCorrelatedLCTDigiCollection products found";
182 for (L1CSCTrackCollection::const_iterator trk = tracks->begin(); trk < tracks->end(); trk++, nTrk++) {
183 int sector = 6 * (trk->first.endcap() - 1) + trk->first.sector() - 1;
184 int tbin = trk->first.BX();
185 edm::LogInfo(
"CSCTFAnalyzer") <<
" Track sector: " << (sector + 1) <<
" tbin: " << tbin <<
" "
186 <<
"TRK(mode=" << ((trk->first.ptLUTAddress() >> 16) & 0xF)
187 <<
",eta=" << trk->first.eta_packed() <<
",phi=" << trk->first.localPhi()
189 <<
" me1D=" << trk->first.me1ID() <<
" t1=" << trk->first.me1Tbin()
190 <<
" me2D=" << trk->first.me2ID() <<
" t2=" << trk->first.me2Tbin()
191 <<
" me3D=" << trk->first.me3ID() <<
" t3=" << trk->first.me3Tbin()
192 <<
" me4D=" << trk->first.me4ID() <<
" t4=" << trk->first.me4Tbin()
193 <<
" mb1D=" << trk->first.mb1ID() <<
" tb=" << trk->first.mb1Tbin();
201 int station = (*csc).first.station() - 1;
202 int cscId = (*csc).first.triggerCscId() - 1;
203 int sector = (*csc).first.triggerSector() - 1;
205 int tbin = lct->getBX();
206 int fpga = (subSector ? subSector - 1 : station + 1);
208 if (sector < 0 || sector > 11 || station < 0 || station > 3 || cscId < 0 || cscId > 8 || lctId < 0 ||
213 if (lct->getQuality() < 100)
215 <<
" Linked LCT: " << (*csc).first.endcap() <<
" station: " << (station + 1)
216 <<
" sector: " << (sector + 1) <<
" subSector: " << subSector <<
" tbin: " << tbin
217 <<
" cscId: " << (cscId + 1) <<
" fpga: " << (fpga + 1) <<
" LCT(vp=" << lct->isValid()
218 <<
",qual=" << lct->getQuality() <<
",wg=" << lct->getKeyWG() <<
",strip=" << lct->getStrip() <<
")";
221 <<
" Linked MB stub: " << (*csc).first.endcap() <<
" sector: " << (sector + 1)
222 <<
" subSector: " << subSector <<
" tbin: " << tbin <<
" MB(vp=" << lct->isValid()
223 <<
",qual=" << (lct->getQuality() - 100) <<
",cal=" << lct->getKeyWG() <<
",flag=" << lct->getStrip()
224 <<
",bc0=" << lct->getPattern() <<
",phiBend=" << lct->getBend() <<
",tbin=" << lct->getBX()
225 <<
",id=" << lct->getMPCLink() <<
",bx0=" << lct->getBX0() <<
",se=" << lct->getSyncErr()
226 <<
",bxn=" << lct->getCSCID() <<
",phi=" << lct->getTrknmb() <<
")";
231 edm::LogInfo(
"CSCTFAnalyzer") <<
" No valid L1CSCTrackCollection products found";
T getUntrackedParameter(std::string const &, T const &) const
const edm::EventSetup & c
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > CSCTC_Tok
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
CSCTFAnalyzer(const edm::ParameterSet &conf)
auto const & tracks
cannot be loose
edm::InputTag lctProducer
edm::InputTag statusProducer
~CSCTFAnalyzer(void) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Log< level::Info, false > LogInfo
edm::InputTag trackProducer
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > CSCCDC_Tok
T const * product() const
std::pair< const_iterator, const_iterator > Range
std::vector< DigiType >::const_iterator const_iterator
static int triggerSubSectorFromLabels(int station, int chamber)
edm::EDGetTokenT< L1CSCTrackCollection > L1CST_Tok
edm::EDGetTokenT< L1CSCStatusDigiCollection > L1CSCS_Tok