CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1NtupleProducer.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1NtupleProducer
4 //
5 //
6 // \class L1NtupleProducer
12 //--------------------------------------------------
13 
14 //-----------------------
15 // This Class's Header --
16 //-----------------------
18 
19 //---------------
20 // C++ Headers --
21 //---------------
22 
23 #include <iostream>
24 #include <iomanip>
25 #include <vector>
26 #include <cmath>
27 
28 
29 //-------------------------------
30 // Collaborating Class Headers --
31 //-------------------------------
32 #include "TROOT.h"
33 #include "TTree.h"
34 #include "TFile.h"
35 
36 
42 
46 
49 
52 
58 
63 
66 
67 //----------------
68 // Constructor --
69 //----------------
70 L1NtupleProducer::L1NtupleProducer(const edm::ParameterSet& ps) : csctfPtLUTs_(NULL), tree_(0) {
71 
72  hltSource_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("hltSource"));
73 
74 //gt, gmt
75  gmtSource_ = consumes<L1MuGMTReadoutCollection>(ps.getParameter<edm::InputTag>("gmtSource"));
76  gtEvmSource_ = consumes<L1GlobalTriggerEvmReadoutRecord>(ps.getParameter<edm::InputTag>("gtEvmSource"));
77  gtSource_ = consumes<L1GlobalTriggerReadoutRecord>(ps.getParameter<edm::InputTag>("gtSource"));
78  generatorSource_ = consumes<reco::GenParticleCollection>(ps.getParameter<edm::InputTag>("generatorSource"));
79  // simulationSource_ = consumes<CaloTowerBxCollection>(ps.getParameter<edm::InputTag>("simulationSource"));
80  physVal_ = ps.getParameter< bool >("physVal");
81 
82 //gct
83  gctCenJetsSource_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctCentralJetsSource"));
84  gctForJetsSource_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctForwardJetsSource"));
85  gctTauJetsSource_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctTauJetsSource"));
86  gctIsoTauJetsSource_ = consumes<L1GctJetCandCollection>(ps.getParameter<edm::InputTag>("gctIsoTauJetsSource"));
87  gctETTSource_ = consumes<L1GctEtTotalCollection>(ps.getParameter<edm::InputTag>("gctETTSource"));
88  gctETMSource_ = consumes<L1GctEtMissCollection>(ps.getParameter<edm::InputTag>("gctETMSource"));
89  gctHTTSource_ = consumes<L1GctEtHadCollection>(ps.getParameter<edm::InputTag>("gctHTTSource"));
90  gctHTMSource_ = consumes<L1GctHtMissCollection>(ps.getParameter<edm::InputTag>("gctHTMSource"));
91  gctHFSumsSource_ = consumes<L1GctHFRingEtSumsCollection>(ps.getParameter<edm::InputTag>("gctHFSumsSource"));
92  gctIsoEmSource_ = consumes<L1GctEmCandCollection>(ps.getParameter<edm::InputTag>("gctIsoEmSource"));
93  gctNonIsoEmSource_ = consumes<L1GctEmCandCollection>(ps.getParameter<edm::InputTag>("gctNonIsoEmSource"));
94  gctHFBitsSource_ = consumes<L1GctHFBitCountsCollection>(ps.getParameter<edm::InputTag>("gctHFBitsSource"));
95 
96  verbose_ = ps.getUntrackedParameter< bool >("verbose", false);
97 
98 //rct
99  rctRgnSource_ = consumes<L1CaloRegionCollection>(ps.getParameter<edm::InputTag>("rctRgnSource"));
100  rctEmSource_ = consumes<L1CaloEmCollection>(ps.getParameter<edm::InputTag>("rctEmSource"));
101 
102 //dt
103  dttfPhSource_ = consumes<L1MuDTChambPhContainer>(ps.getParameter<edm::InputTag>("dttfPhSource"));
104  dttfThSource_ = consumes<L1MuDTChambThContainer>(ps.getParameter<edm::InputTag>("dttfThSource"));
105  dttfTrkSource_ = consumes<L1MuDTTrackContainer>(ps.getParameter<edm::InputTag>("dttfTrkSource"));
106 
107 //ecal/hcal
108  ecalSource_ = consumes<EcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("ecalSource"));
109  hcalSource_ = consumes<HcalTrigPrimDigiCollection>(ps.getParameter<edm::InputTag>("hcalSource"));
110 
111 //csctf
112  csctfTrkSource_ = consumes<L1CSCTrackCollection>(ps.getParameter<edm::InputTag>("csctfTrkSource"));
113  csctfLCTSource_ = consumes<CSCCorrelatedLCTDigiCollection>(ps.getParameter<edm::InputTag>("csctfLCTSource"));
114  csctfStatusSource_ = consumes<L1CSCStatusDigiCollection>(ps.getParameter<edm::InputTag>("csctfStatusSource"));
115  csctfDTStubsSource_ = consumes<CSCTriggerContainer<csctf::TrackStub> >(ps.getParameter<edm::InputTag>("csctfDTStubsSource"));
116 
117  initCSCTFPtLutsPSet = ps.getParameter< bool >("initCSCTFPtLutsPSet");
118  csctfPtLutsPSet = ps.getParameter<edm::ParameterSet>("csctfPtLutsPSet");
119 
120 //maximum allowed size of tree vectors
121  maxRPC_ = ps.getParameter<unsigned int>("maxRPC");
122  maxDTBX_ = ps.getParameter<unsigned int>("maxDTBX");
123  maxCSC_ = ps.getParameter<unsigned int>("maxCSC");
124  maxGMT_ = ps.getParameter<unsigned int>("maxGMT");
125  maxGT_ = ps.getParameter<unsigned int>("maxGT");
126  maxRCTREG_ = ps.getParameter<unsigned int>("maxRCTREG");
127  maxDTPH_ = ps.getParameter<unsigned int>("maxDTPH");
128  maxDTTH_ = ps.getParameter<unsigned int>("maxDTTH");
129  maxDTTR_ = ps.getParameter<unsigned int>("maxDTTR");
130  maxGEN_ = ps.getParameter<unsigned int>("maxGEN");
131  maxCSCTFTR_ = ps.getParameter<unsigned int>("maxCSCTFTR");
132  maxCSCTFLCTSTR_ = ps.getParameter<unsigned int>("maxCSCTFLCTSTR");
133  maxCSCTFLCTS_ = ps.getParameter<unsigned int>("maxCSCTFLCTS");
134  maxCSCTFSPS_ = ps.getParameter<unsigned int>("maxCSCTFSPS");
135 
136  hcalScaleCacheID_ = 0;
137  ecalScaleCacheID_ = 0;
138 
139  std::string puMCFile = ps.getUntrackedParameter<std::string>("puMCFile", "");
140  std::string puMCHist = ps.getUntrackedParameter<std::string>("puMCHist", "pileup");
141  std::string puDataFile = ps.getUntrackedParameter<std::string>("puDataFile", "");
142  std::string puDataHist = ps.getUntrackedParameter<std::string>("puDataHist", "pileup");
143 
144  bool useAvgVtx = ps.getUntrackedParameter<bool>("useAvgVtx", true);
145  double maxAllowedWeight = ps.getUntrackedParameter<double>("maxAllowedWeight", -1);
146 
147  pL1evt = new L1Analysis::L1AnalysisEvent(puMCFile, puMCHist,
148  puDataFile, puDataHist,
149  useAvgVtx, maxAllowedWeight);
151  pL1rct = new L1Analysis::L1AnalysisRCT(maxRCTREG_);
159 
160 
161  pL1evt_data = pL1evt->getData();
164  pL1gt_data = pL1gt->getData();
171 
172  initCSCTF();
173 
174  tree_ = tfs_->make<TTree>("L1Tree", "L1Tree");
175 
176  book();
177 }
178 
179 //--------------
180 // Destructor --
181 //--------------
183 
184  //free the CSCTF array of pointers
185  for(unsigned int j=0; j<2; j++)
186  for(unsigned int i=0; i<5; i++)
187  delete srLUTs_[i][j];
188  delete csctfPtLUTs_;
189 
190  delete pL1evt;
191  delete pL1gmt;
192  delete pL1rct;
193  delete pL1gct;
194  delete pL1gt;
195  delete pL1dttf;
196  delete pL1csctf;
197  delete pL1calotp;
198  delete pL1generator;
199  delete pL1simulation;
200 }
201 
203 }
204 
206 
207 }
208 
209 //--------------
210 // Operations --
211 //--------------
212 
214 
215  //add if "none" ..
216  analyzeEvent(e);
217  analyzeGenerator(e);
219  analyzeGMT(e);
220  analyzeGT(e);
221  analyzeGCT(e);
222  analyzeRCT(e);
223  analyzeDTTF(e);
224  analyzeCSCTF(e,es);
225  // pL1calotp->Reset();
226  // analyzeECAL(e, es);
227  // analyzeHCAL(e, es);
228 
229  tree_->Fill();
230 
231 }
232 
233 
235 
236  if(!hltSource_.isUninitialized()) {
237  pL1evt->Reset();
238  pL1evt->Set(e,hltSource_);
239  }
240 }
241 
243 
245  pL1generator->Reset();
246  // pL1generator->Set(e);
247  }
248 
249 }
250 
252 
253  pL1simulation->Reset();
254  // pL1simulation->Set(e);
255 
256 }
257 
258 
260 
261  pL1gmt->Reset();
262 
263  if (!gmtSource_.isUninitialized()) {
264  // edm::Handle<L1MuGMTReadoutCollection> gmtrc_handle;
265  // e.getByToken(gmtSource_,gmtrc_handle);
266  // L1MuGMTReadoutCollection const* gmtrc = gmtrc_handle.product();
267 
268  // pL1gmt->Set(gmtrc, maxDTBX_, maxCSC_, maxRPC_, maxGMT_, physVal_);
269  }
270 }
271 
272 
274 
275  pL1gt->Reset();
276 
277  if (!gtEvmSource_.isUninitialized()) {
278  // edm::Handle<L1GlobalTriggerEvmReadoutRecord> gtevmrr_handle;
279  // e.getByToken(gtEvmSource_, gtevmrr_handle);
280  // L1GlobalTriggerEvmReadoutRecord const* gtevmrr = gtevmrr_handle.product();
281 
282  // L1TcsWord tcsw = gtevmrr->tcsWord();
283 
284  // pL1evt_data->bx = tcsw.bxNr();
285  // pL1evt_data->orbit = tcsw.orbitNr();
286  // //pL1evt->lumi = tcsw.luminositySegmentNr();
287  // //pL1evt->run = tcsw.partRunNr();
288  // //pL1evt->event = tcsw.partTrigNr();
289 
290  // pL1gt->SetEvm(gtevmrr);
291  }
292 
293 
294  if (!gtSource_.isUninitialized()) {
295  // edm::Handle<L1GlobalTriggerReadoutRecord> gtrr_handle;
296  // e.getByToken(gtSource_, gtrr_handle);
297  // L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
298 
299  // pL1gt->Set(gtrr);
300  }
301 }
302 
303 
304 
306 
307  pL1rct->Reset();
308 
309  // edm::Handle < L1CaloEmCollection > em;
310  // e.getByToken(rctSource_,em);
311  // if (!em.isValid()) {
312  // pL1rct->SetEmRCT(em);
313  // }
314  // edm::Handle < L1CaloRegionCollection > rgn;
315  // e.getByToken(rctSource_,rgn);
316  // if (!rgn.isValid()) {
317  // pL1rct->SetHdRCT(rgn);
318  // }
319 
320 }
321 
322 
324 {
325 
326  pL1dttf->Reset();
327 
328  // edm::Handle<L1MuDTChambPhContainer > myL1MuDTChambPhContainer;
329  // e.getByToken(dttfSource_,myL1MuDTChambPhContainer);
330  // if (myL1MuDTChambPhContainer.isValid()) {
331  // pL1dttf->SetDTPH(myL1MuDTChambPhContainer, maxDTPH_);
332  // }
333  // edm::Handle<L1MuDTChambThContainer > myL1MuDTChambThContainer;
334  // e.getByToken(dttfSource_,myL1MuDTChambThContainer);
335  // if (myL1MuDTChambThContainer.isValid()) {
336  // pL1dttf->SetDTTH(myL1MuDTChambThContainer, maxDTTH_);
337  // }
338 
339  // edm::Handle<L1MuDTTrackContainer > myL1MuDTTrackContainer;
340  // edm::InputTag trInputTag(trstring);
341  // e.getByToken(trInputTag,myL1MuDTTrackContainer);
342  // if (myL1MuDTTrackContainer.isValid()) {
343  // pL1dttf->SetDTTR(myL1MuDTTrackContainer, maxDTTR_);
344  // }
345  // else {
346  // e.getByToken(trInputTag,myL1MuDTTrackContainer);
347  // if (myL1MuDTTrackContainer.isValid()) {
348  // pL1dttf->SetDTTR(myL1MuDTTrackContainer, maxDTTR_);
349  // }
350  // else {
351  // edm::LogInfo("L1Prompt") << "can't find L1MuDTTrackContainer " << dttfSource_.label();
352  // }
353  // }
354 
355 }
356 
357 
358 
360 {
361 
362  pL1gct->Reset();
363 
365 
366  // edm::Handle < L1GctEmCandCollection > l1IsoEm;
367  // e.getByToken(gctIsoEmSource_, l1IsoEm);
368  // if (!l1IsoEm.isValid())
369  // edm::LogWarning("DataNotFound") << " Could not find l1IsoEm "" elements, label was " << gctIsoEmSource_ ;
370 
371  // edm::Handle < L1GctEmCandCollection > l1NonIsoEm;
372  // e.getByToken(gctNonIsoEmSource_, l1NonIsoEm);
373  // if (!l1NonIsoEm.isValid())
374  // edm::LogWarning("DataNotFound") << " Could not find l1NonIsoEm "" elements, label was " << gctNonIsoEmSource_ ;
375 
376  // if (l1IsoEm.isValid() && l1NonIsoEm.isValid())
377  // pL1gct->SetEm(l1IsoEm, l1NonIsoEm);
378  // else
379  // pL1gct_data->Init();
380 
382 
383  // edm::Handle < L1GctJetCandCollection > l1CenJets;
384  // e.getByToken(gctCenJetsSource_, l1CenJets);
385  // if (!l1CenJets.isValid())
386  // edm::LogWarning("DataNotFound") << " Could not find l1CenJets"", label was " << gctCenJetsSource_ ;
387 
388  // edm::Handle < L1GctJetCandCollection > l1ForJets;
389  // e.getByToken(gctForJetsSource_, l1ForJets);
390  // if (!l1ForJets.isValid())
391  // edm::LogWarning("DataNotFound") << " Could not find l1ForJets"", label was " << gctForJetsSource_ ;
392 
393  // edm::Handle < L1GctJetCandCollection > l1TauJets;
394  // e.getByToken(gctTauJetsSource_, l1TauJets);
395  // if (!l1TauJets.isValid())
396  // edm::LogWarning("DataNotFound") << " Could not find l1TauJets"", label was " << gctTauJetsSource_;
397 
398  // edm::Handle < L1GctJetCandCollection > l1IsoTauJets;
399  // e.getByToken(gctIsoTauJetsSource_, l1IsoTauJets);
400  // if (!l1IsoTauJets.isValid())
401  // edm::LogWarning("DataNotFound") << " Could not find l1IsoTauJets"", label was " << gctIsoTauJetsSource_;
402 
403  // if (l1CenJets.isValid() && l1ForJets.isValid() && l1TauJets.isValid())
404  // pL1gct->SetJet(l1CenJets, l1ForJets, l1TauJets, l1IsoTauJets);
405 
407 
408  // edm::Handle < L1GctHFRingEtSumsCollection > l1HFSums;
409  // e.getByToken(gctHFSumsSource_, l1HFSums);
410  // if (!l1HFSums.isValid())
411  // edm::LogWarning("DataNotFound") << " Could not find l1HFSums"", label was " << gctEnergySumsSource_ ;
412 
413  // edm::Handle < L1GctHFBitCountsCollection > l1HFCounts;
414  // e.getByToken(gctHFBitsSource_, l1HFCounts);
415  // if (!l1HFCounts.isValid())
416  // edm::LogWarning("DataNotFound") << " Could not find l1HFCounts"", label was " << gctEnergySumsSource_ ;
417 
418  // if (l1HFSums.isValid() && l1HFCounts.isValid())
419  // pL1gct->SetHFminbias(l1HFSums, l1HFCounts);
420 
422 
423  // edm::Handle < L1GctEtMissCollection > l1EtMiss;
424  // e.getByToken(gctETMSource_, l1EtMiss);
425  // if (!l1EtMiss.isValid())
426  // edm::LogWarning("DataNotFound") << " Could not find l1EtMiss"", label was " << gctEnergySumsSource_ ;
427 
428  // edm::Handle < L1GctHtMissCollection > l1HtMiss;
429  // e.getByToken(gctHTMSource_, l1HtMiss);
430  // if (!l1HtMiss.isValid())
431  // edm::LogWarning("DataNotFound") << " Could not find l1HtMiss"", label was " << gctEnergySumsSource_ ;
432 
433  // edm::Handle < L1GctEtHadCollection > l1EtHad;
434  // e.getByToken(gctHTTSource_, l1EtHad);
435  // if (!l1EtHad.isValid())
436  // edm::LogWarning("DataNotFound") << " Could not find l1EtHad"", label was " << gctEnergySumsSource_ ;
437 
438  // edm::Handle < L1GctEtTotalCollection > l1EtTotal;
439  // e.getByToken(gctETTSource_, l1EtTotal);
440  // if (!l1EtTotal.isValid())
441  // edm::LogWarning("DataNotFound") << " Could not find l1EtTotal"", label was " << gctEnergySumsSource_ ;
442 
443  // if (l1EtMiss.isValid() && l1HtMiss.isValid() && l1EtHad.isValid() && l1EtTotal.isValid())
444  // pL1gct->SetES(l1EtMiss, l1HtMiss, l1EtHad, l1EtTotal);
445 
446 }
447 
449 {
450 
451  pL1csctf->Reset();
452 
453  //csctf (tracks)
454  // if( csctfTrkSource_.label() != "none" )
455  // {
456  // if( es.get< L1MuTriggerScalesRcd > ().cacheIdentifier() != m_scalesCacheID ||
457  // es.get< L1MuTriggerPtScaleRcd >().cacheIdentifier() != m_ptScaleCacheID ){
458 
459  // edm::ESHandle< L1MuTriggerScales > scales;
460  // es.get< L1MuTriggerScalesRcd >().get(scales);
461  // ts = scales.product();
462  // edm::ESHandle< L1MuTriggerPtScale > ptscales;
463  // es.get< L1MuTriggerPtScaleRcd >().get(ptscales);
464  // tpts = ptscales.product();
465  // m_scalesCacheID = es.get< L1MuTriggerScalesRcd >().cacheIdentifier();
466  // m_ptScaleCacheID = es.get< L1MuTriggerPtScaleRcd >().cacheIdentifier();
467 
468  // edm::LogInfo("L1NtupleProducer") << "Changing triggerscales and triggerptscales for CSCTF...\n";
469  // }
470 
471  // // initialize ptLUTs from a PSet if the flag is True
472  // if( initCSCTFPtLutsPSet )
473  // {
474  // // set it only if the pointer is empty
475  // if (csctfPtLUTs_ == NULL) {
476  // edm::LogInfo("L1NtupleProducer") << "Initializing csctf pt LUTs from PSet...";
477  // csctfPtLUTs_ = new CSCTFPtLUT(csctfPtLutsPSet, ts, tpts);
478  // }
479  // }
480 
481  // otherwise use the O2O mechanism
482  // else if (es.get< L1MuCSCPtLutRcd > ().cacheIdentifier() != m_csctfptlutCacheID )
483  // {
484  // edm::LogInfo("L1NtupleProducer") << " Initializing the CSCTF ptLUTs via O2O mechanism...";
485  // // initializing the ptLUT from O2O
486  // csctfPtLUTs_ = new CSCTFPtLUT(es);
487 
488  // m_csctfptlutCacheID = es.get< L1MuCSCPtLutRcd > ().cacheIdentifier();
489  // edm::LogInfo("L1NtupleProducer") << " Changed the cache ID for CSCTF ptLUTs...";
490  // }
491 
492  // if (csctfPtLUTs_ == NULL)
493  // edm::LogWarning("L1NtupleProducer")<<" No valid CSCTFPtLUT initialized!";
494 
495 
496  // edm::Handle<L1CSCTrackCollection> csctfTrks;
497  // e.getByToken(csctfTrkSource_,csctfTrks);
498 
499  // if( csctfTrks.isValid() && csctfPtLUTs_)
500  // pL1csctf->SetTracks(csctfTrks, ts, tpts, srLUTs_, csctfPtLUTs_);
501  // else
502  // edm::LogInfo("L1NtupleProducer")<<" No valid L1CSCTrackCollection products found"
503  // <<" or ptLUT pointer(" << csctfPtLUTs_ <<") null";
504 
505 
506  // } else
507  // edm::LogInfo("L1NtupleProducer")<<" No valid L1CSCTrackCollection products found";
508 
509 
510 
511  //ALL csctf lcts
512  // if(!csctfLCTSource_.isUninitialized())
513  // {
514  // edm::Handle<CSCCorrelatedLCTDigiCollection> corrlcts;
515  // e.getByToken(csctfLCTSource_,corrlcts);
516  // if( corrlcts.isValid() ) pL1csctf->SetLCTs(corrlcts, srLUTs_);
517  // } else
518  // edm::LogInfo("L1NtupleProducer")<<" No valid CSCCorrelatedLCTDigiCollection products found";
519 
520 
521  //csctf status
522  // if(!csctfStatusSource_.isUninitialized())
523  // {
524  // edm::Handle<L1CSCStatusDigiCollection> status;
525  // e.getByToken(csctfStatusSource_,status);
526  // if( status.isValid() ) pL1csctf->SetStatus(status);
527  // } else
528  // edm::LogInfo("L1NtupleProducer")<<" No valid L1CSCTrackCollection products found";
529 
530  //dt stubs
531  // if(!csctfDTStubsSource_.isUninitialized()) {
532  // edm::Handle<CSCTriggerContainer<csctf::TrackStub> > dtStubs;
533  // e.getByToken(csctfDTStubsSource_,dtStubs);
534  // if( dtStubs.isValid() ) {
535  // pL1csctf->SetDTStubs(dtStubs);
536  // } else {
537  // edm::LogInfo("L1NtupleProducer")<<" No valid DT TrackStub products found";
538  // }
539  // } else
540  // edm::LogInfo("L1NtupleProducer")<<" Label for DTStubsSource is set to none"
541  ;
542 }
543 
545 
548  es.get<L1CaloEcalScaleRcd>().get(ecalScale);
549  pL1calotp->setEcalScale( ecalScale.product() );
550  ecalScaleCacheID_ = es.get< L1CaloEcalScaleRcd > ().cacheIdentifier();
551  }
552 
553  if(!ecalSource_.isUninitialized()) {
554 
556  e.getByToken(ecalSource_,ecalTPs);
557 
558  if( ecalTPs.isValid() ) {
559  pL1calotp->SetECAL( *ecalTPs.product());
560  } else {
561  edm::LogInfo("L1NtupleProducer")<<" No valid ECAL trigger primitives found";
562  }
563  } else
564  edm::LogInfo("L1NtupleProducer")<<" Label for ECAL trig prims is set to none";
565 
566 }
567 
569 
570  // if( es.get< L1CaloHcalScaleRcd > ().cacheIdentifier() != hcalScaleCacheID_ ) {
572  es.get<L1CaloHcalScaleRcd>().get(hcalScale);
573  pL1calotp->setHcalScale( hcalScale.product() );
574  hcalScaleCacheID_ = es.get< L1CaloHcalScaleRcd > ().cacheIdentifier();
575  // }
576 
577  if (!hcalSource_.isUninitialized()) {
578 
580  e.getByToken(hcalSource_,hcalTPs);
581 
582  if( hcalTPs.isValid() ) {
583  pL1calotp->SetHCAL(*hcalTPs.product());
584  } else {
585  edm::LogInfo("L1NtupleProducer")<<" No valid HCAL trigger primitives found";
586  }
587  } else
588  edm::LogInfo("L1NtupleProducer")<<" Label for HCAL trig prims is set to none";
589 
590 }
591 
592 
593 //--------------
594 // Operations --
595 //--------------
597 
598  tree_->Branch("Event", "L1Analysis::L1AnalysisEventDataFormat", &pL1evt_data, 32000, 3);
599 
600  tree_->Branch("Simulation", "L1Analysis::L1AnalysisSimulationDataFormat", &pL1simulation_data, 32000, 3);
601 
613  tree_->Branch("GCT", "L1Analysis::L1AnalysisGCTDataFormat", &pL1gct_data, 32000, 3);
614 
616  tree_->Branch("Generator", "L1Analysis::L1AnalysisGeneratorDataFormat", &pL1generator_data, 32000, 3);
617 
618  if (!gmtSource_.isUninitialized())
619  tree_->Branch("GMT", "L1Analysis::L1AnalysisGMTDataFormat", &pL1gmt_data, 32000, 3);
620 
621  if (!gtSource_.isUninitialized())
622  tree_->Branch("GT", "L1Analysis::L1AnalysisGTDataFormat", &pL1gt_data, 32000, 3);
623 
625  tree_->Branch("RCT", "L1Analysis::L1AnalysisRCTDataFormat", &pL1rct_data, 32000, 3);
626 
630  tree_->Branch("DTTF", "L1Analysis::L1AnalysisDTTFDataFormat", &pL1dttf_data, 32000, 3);
635  tree_->Branch("CSCTF", "L1Analysis::L1AnalysisCSCTFDataFormat", &pL1csctf_data, 32000, 3);
636 
637  if (!ecalSource_.isUninitialized() && !hcalSource_.isUninitialized()) {
638  tree_->Branch("CALO", "L1Analysis::L1AnalysisCaloTPDataFormat", &pL1calotp_data, 32000, 3);
639  }
640 
641 }
642 
644 
645  // csctf does not preserve information about the LCT (stubs) which forms
646  // the track so we need to retrieve this information. In order to do so
647  // we need to initialize the Sector Receiver LUTs in the software
648 
649  bzero(srLUTs_ , sizeof(srLUTs_));
650  int sector=1; // assume SR LUTs are all same for every sector
651  bool TMB07=true; // specific TMB firmware
652  // Create a pset for SR/PT LUTs: if you do not change the value in the
653  // configuration file, it will load the default minitLUTs
654  edm::ParameterSet srLUTset;
655  srLUTset.addUntrackedParameter<bool>("ReadLUTs", false);
656  srLUTset.addUntrackedParameter<bool>("Binary", false);
657  srLUTset.addUntrackedParameter<std::string>("LUTPath", "./");
658 
659  // positive endcap
660  int endcap = 1;
661  for(int station=1,fpga=0; station<=4 && fpga<5; station++)
662  {
663  if(station==1)
664  for(int subSector=0; subSector<2 && fpga<5; subSector++)
665  srLUTs_[fpga++][1] = new CSCSectorReceiverLUT(endcap,sector,subSector+1,
666  station, srLUTset, TMB07);
667  else
668  srLUTs_[fpga++][1] = new CSCSectorReceiverLUT(endcap, sector, 0,
669  station, srLUTset, TMB07);
670  }
671 
672  // negative endcap
673  endcap = 2;
674  for(int station=1,fpga=0; station<=4 && fpga<5; station++)
675  {
676  if(station==1)
677  for(int subSector=0; subSector<2 && fpga<5; subSector++)
678  srLUTs_[fpga++][0] = new CSCSectorReceiverLUT(endcap,sector,subSector+1,
679  station, srLUTset, TMB07);
680  else
681  srLUTs_[fpga++][0] = new CSCSectorReceiverLUT(endcap, sector, 0,
682  station, srLUTset, TMB07);
683  }
684 
685 }
686 
L1NtupleProducer(const edm::ParameterSet &)
void analyzeCSCTF(const edm::Event &e, const edm::EventSetup &)
edm::EDGetTokenT< L1GctHFRingEtSumsCollection > gctHFSumsSource_
T getParameter(std::string const &) const
unsigned long long cacheIdentifier() const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void analyzeGenerator(const edm::Event &e)
edm::EDGetTokenT< L1MuDTChambThContainer > dttfThSource_
L1Analysis::L1AnalysisSimulationDataFormat * pL1simulation_data
void SetHCAL(const HcalTrigPrimDigiCollection &hcalTPs)
void analyzeGCT(const edm::Event &e)
L1Analysis::L1AnalysisGCT * pL1gct
edm::EDGetTokenT< L1GctHtMissCollection > gctHTMSource_
void analyzeECAL(const edm::Event &e, const edm::EventSetup &)
edm::Service< TFileService > tfs_
L1AnalysisSimulationDataFormat * getData()
void analyzeRCT(const edm::Event &e)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< L1GctJetCandCollection > gctCenJetsSource_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::EDGetTokenT< HcalTrigPrimDigiCollection > hcalSource_
unsigned int maxGMT_
L1AnalysisRCTDataFormat * getData()
Definition: L1AnalysisRCT.h:28
edm::EDGetTokenT< L1CaloEmCollection > rctEmSource_
edm::ParameterSet csctfPtLutsPSet
unsigned int maxDTBX_
edm::EDGetTokenT< L1GctEmCandCollection > gctIsoEmSource_
L1AnalysisGeneratorDataFormat * getData()
L1Analysis::L1AnalysisCSCTFDataFormat * pL1csctf_data
#define NULL
Definition: scimark2.h:8
virtual void endJob()
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
L1AnalysisGTDataFormat * getData()
Definition: L1AnalysisGT.h:28
unsigned int maxCSCTFLCTSTR_
edm::EDGetTokenT< L1GctEmCandCollection > gctNonIsoEmSource_
edm::EDGetTokenT< L1MuGMTReadoutCollection > gmtSource_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecalSource_
edm::EDGetTokenT< L1GctJetCandCollection > gctTauJetsSource_
void analyzeHCAL(const edm::Event &e, const edm::EventSetup &)
L1Analysis::L1AnalysisCaloTP * pL1calotp
virtual void analyze(const edm::Event &, const edm::EventSetup &)
L1Analysis::L1AnalysisEvent * pL1evt
void setHcalScale(const L1CaloHcalScale *hcalScale)
unsigned int maxCSCTFTR_
void analyzeDTTF(const edm::Event &e)
edm::EDGetTokenT< L1GctEtMissCollection > gctETMSource_
edm::EDGetTokenT< reco::GenParticleCollection > generatorSource_
L1AnalysisDTTFDataFormat * getData()
void analyzeGT(const edm::Event &e)
edm::EDGetTokenT< L1MuDTChambPhContainer > dttfPhSource_
L1AnalysisGCTDataFormat * getData()
Definition: L1AnalysisGCT.h:42
unsigned int maxDTTH_
edm::EDGetTokenT< L1GctEtTotalCollection > gctETTSource_
edm::EDGetTokenT< L1CSCTrackCollection > csctfTrkSource_
L1Analysis::L1AnalysisGTDataFormat * pL1gt_data
unsigned int maxDTTR_
edm::EDGetTokenT< L1GctJetCandCollection > gctIsoTauJetsSource_
L1Analysis::L1AnalysisRCTDataFormat * pL1rct_data
L1AnalysisGMTDataFormat * getData()
Definition: L1AnalysisGMT.h:23
CSCSectorReceiverLUT * srLUTs_[5][2]
int j
Definition: DBlmapReader.cc:9
L1Analysis::L1AnalysisGenerator * pL1generator
L1Analysis::L1AnalysisGMTDataFormat * pL1gmt_data
edm::EDGetTokenT< L1MuDTTrackContainer > dttfTrkSource_
edm::EDGetTokenT< L1GctJetCandCollection > gctForJetsSource_
void analyzeSimulation(const edm::Event &e)
L1Analysis::L1AnalysisSimulation * pL1simulation
edm::EDGetTokenT< L1CaloRegionCollection > rctRgnSource_
virtual void beginJob(void)
bool isValid() const
Definition: HandleBase.h:75
unsigned int maxCSCTFLCTS_
virtual ~L1NtupleProducer()
L1Analysis::L1AnalysisGT * pL1gt
L1AnalysisCaloTPDataFormat * getData()
L1Analysis::L1AnalysisRCT * pL1rct
CSCTFPtLUT * csctfPtLUTs_
void Set(const edm::Event &e, const edm::EDGetTokenT< edm::TriggerResults > &hlt_)
L1Analysis::L1AnalysisGCTDataFormat * pL1gct_data
unsigned int maxGT_
L1Analysis::L1AnalysisDTTF * pL1dttf
void analyzeEvent(const edm::Event &e)
L1Analysis::L1AnalysisGMT * pL1gmt
T const * product() const
Definition: Handle.h:81
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:208
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
L1Analysis::L1AnalysisCSCTF * pL1csctf
void setEcalScale(const L1CaloEcalScale *ecalScale)
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtSource_
edm::EDGetTokenT< L1GctHFBitCountsCollection > gctHFBitsSource_
unsigned int maxDTPH_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > csctfLCTSource_
edm::EDGetTokenT< L1CSCStatusDigiCollection > csctfStatusSource_
L1Analysis::L1AnalysisEventDataFormat * pL1evt_data
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmSource_
unsigned long long hcalScaleCacheID_
edm::EDGetTokenT< edm::TriggerResults > hltSource_
unsigned long long ecalScaleCacheID_
edm::EDGetTokenT< L1GctEtHadCollection > gctHTTSource_
bool isUninitialized() const
Definition: EDGetToken.h:73
unsigned int maxRCTREG_
L1Analysis::L1AnalysisDTTFDataFormat * pL1dttf_data
unsigned int maxCSCTFSPS_
L1Analysis::L1AnalysisCaloTPDataFormat * pL1calotp_data
L1AnalysisCSCTFDataFormat * getData()
L1Analysis::L1AnalysisGeneratorDataFormat * pL1generator_data
void SetECAL(const EcalTrigPrimDigiCollection &ecalTPs)
unsigned int maxCSC_
void analyzeGMT(const edm::Event &e)
unsigned int maxGEN_
edm::EDGetTokenT< CSCTriggerContainer< csctf::TrackStub > > csctfDTStubsSource_
unsigned int maxRPC_