CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1RCTTestAnalyzer Class Reference

#include <src/L1RCTTestAnalyzer/src/L1RCTTestAnalyzer.cc>

Inheritance diagram for L1RCTTestAnalyzer:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
 L1RCTTestAnalyzer (const edm::ParameterSet &)
 
 ~L1RCTTestAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

edm::InputTag ecalDigisLabel
 
TH1F * h_ecalTimeSample
 
TH1F * h_emCandTimeSample
 
TH1F * h_emIeta
 
TH1F * h_emIphi
 
TH1F * h_emIso
 
TH2F * h_emIsoInIetaIphi
 
TH2F * h_emNonIsoInIetaIphi
 
TH1F * h_emRank
 
TH2F * h_emRankInIetaIphi
 
TH1F * h_emRankOutOfTime
 
TH1F * h_hcalTimeSample
 
TH2F * h_regionFGInIetaIphi
 
TH1F * h_regionIeta
 
TH1F * h_regionIphi
 
TH1F * h_regionMip
 
TH1F * h_regionSum
 
TH2F * h_regionSumInIetaIphi
 
TH1F * h_towerMip
 
edm::InputTag hcalDigisLabel
 
std::string m_HepMCProduct
 
edm::InputTag rctDigisLabel
 
bool showEmCands
 
bool showRegionSums
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 47 of file L1RCTTestAnalyzer.h.

Constructor & Destructor Documentation

L1RCTTestAnalyzer::L1RCTTestAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 27 of file L1RCTTestAnalyzer.cc.

References h_ecalTimeSample, h_emCandTimeSample, h_emIeta, h_emIphi, h_emIso, h_emIsoInIetaIphi, h_emNonIsoInIetaIphi, h_emRank, h_emRankInIetaIphi, h_emRankOutOfTime, h_hcalTimeSample, h_regionFGInIetaIphi, h_regionIeta, h_regionIphi, h_regionMip, h_regionSum, h_regionSumInIetaIphi, h_towerMip, and TFileDirectory::make().

27  :
28  showEmCands(iConfig.getUntrackedParameter<bool>("showEmCands")),
29  showRegionSums(iConfig.getUntrackedParameter<bool>("showRegionSums")),
30  ecalDigisLabel(iConfig.getParameter<edm::InputTag>("ecalDigisLabel")),
31  hcalDigisLabel(iConfig.getParameter<edm::InputTag>("hcalDigisLabel")),
32  rctDigisLabel(iConfig.getParameter<edm::InputTag>("rctDigisLabel"))
33 {
34  //now do what ever initialization is needed
35 
37  h_emRank = fs->make<TH1F>( "emRank", "emRank", 64, 0., 64. );
38  h_emRankOutOfTime = fs->make<TH1F>( "emRankOutOfTime", "emRankOutOfTime",
39  64, 0., 64. );
40  h_emIeta = fs->make<TH1F>( "emIeta", "emIeta", 22, 0., 22. );
41  h_emIphi = fs->make<TH1F>( "emIphi", "emIphi", 18, 0., 18. );
42  h_emIso = fs->make<TH1F>( "emIso", "emIso", 2, 0., 2. );
43  h_emRankInIetaIphi = fs->make<TH2F>( "emRank2D", "emRank2D", 22, 0., 22.,
44  18, 0., 18. );
45  h_emIsoInIetaIphi = fs->make<TH2F>( "emIso2D", "emIso2D", 22, 0., 22.,
46  18, 0., 18. );
47  h_emNonIsoInIetaIphi = fs->make<TH2F>( "emNonIso2D", "emNonIso2D", 22, 0.,
48  22., 18, 0., 18. );
49  h_emCandTimeSample = fs->make<TH1F>( "emCandTimeSample", "emCandTimeSample",
50  5, -2., 2.);
51 
52  h_regionSum = fs->make<TH1F>( "regionSum", "regionSum", 100, 0., 100. );
53  h_regionIeta = fs->make<TH1F>( "regionIeta", "regionIeta", 22, 0., 22. );
54  h_regionIphi = fs->make<TH1F>( "regionIphi", "regionIphi", 18, 0., 18. );
55  h_regionMip = fs->make<TH1F>( "regionMip", "regionMipBit", 2, 0., 2. );
56  h_regionSumInIetaIphi = fs->make<TH2F>( "regionSum2D", "regionSum2D", 22,
57  0., 22., 18, 0., 18. );
58  h_regionFGInIetaIphi = fs->make<TH2F>( "regionFG2D", "regionFG2D", 22, 0.,
59  22., 18, 0., 18. );
60 
61  h_towerMip = fs->make<TH1F>( "towerMip", "towerMipBit", 2, 0., 2. );
62 
63  h_ecalTimeSample = fs->make<TH1F>( "ecalTimeSample", "ecalTimeSample",
64  10, 0., 10. );
65  h_hcalTimeSample = fs->make<TH1F>( "hcalTimeSample", "hcalTimeSample",
66  10, 0., 10. );
67 
68  // get names of modules, producing object collections
69 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag rctDigisLabel
edm::InputTag hcalDigisLabel
edm::InputTag ecalDigisLabel
T * make() const
make new ROOT object
L1RCTTestAnalyzer::~L1RCTTestAnalyzer ( )

Definition at line 72 of file L1RCTTestAnalyzer.cc.

73 {
74 
75  // do anything here that needs to be done at destruction time
76  // (e.g. close files, deallocate resources etc.)
77 
78 }

Member Function Documentation

void L1RCTTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 87 of file L1RCTTestAnalyzer.cc.

References gather_cfg::cout, patCandidatesForDimuonsSequences_cff::ecal, ecalDigisLabel, edm::EventSetup::get(), edm::Event::getByLabel(), h_ecalTimeSample, h_emCandTimeSample, h_emIeta, h_emIphi, h_emIso, h_emIsoInIetaIphi, h_emNonIsoInIetaIphi, h_emRank, h_emRankInIetaIphi, h_emRankOutOfTime, h_hcalTimeSample, h_regionFGInIetaIphi, h_regionIeta, h_regionIphi, h_regionMip, h_regionSum, h_regionSumInIetaIphi, h_towerMip, patCandidatesForDimuonsSequences_cff::hcal, hcalDigisLabel, rctDigisLabel, showEmCands, and showRegionSums.

88 {
89  using namespace edm;
90 #ifdef THIS_IS_AN_EVENT_EXAMPLE
92  iEvent.getByLabel("example",pIn);
93 #endif
94 
95 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE
96  ESHandle<SetupData> pSetup;
97  iSetup.get<SetupRecord>().get(pSetup);
98 #endif
99 
100  // as in L1GctTestAnalyzer.cc
101  Handle<L1CaloEmCollection> rctEmCands;
105 
106  L1CaloEmCollection::const_iterator em;
107  L1CaloRegionCollection::const_iterator rgn;
110 
111  iEvent.getByLabel(rctDigisLabel, rctEmCands);
112  iEvent.getByLabel(rctDigisLabel, rctRegions);
113  iEvent.getByLabel(ecalDigisLabel, ecalColl);
114  iEvent.getByLabel(hcalDigisLabel, hcalColl);
115 
116  for (ecal=ecalColl->begin(); ecal!=ecalColl->end(); ecal++)
117  {
118  for (unsigned short sample = 0; sample < (*ecal).size(); sample++)
119  {
120  h_ecalTimeSample->Fill(sample);
121  }
122  }
123 
124  for (hcal=hcalColl->begin(); hcal!=hcalColl->end(); hcal++)
125  {
126  h_towerMip->Fill( (*hcal).SOI_fineGrain() );
127  for (unsigned short sample = 0; sample < (*hcal).size(); sample++)
128  {
129  h_hcalTimeSample->Fill(sample);
130  }
131  }
132 
133  if(showEmCands)
134  {
135  std::cout << std::endl << "L1 RCT EmCand objects" << std::endl;
136  }
137  for (em=rctEmCands->begin(); em!=rctEmCands->end(); em++){
138  // std::cout << "(Analyzer)\n" << (*em) << std::endl;
139  h_emCandTimeSample->Fill((*em).bx());
140  if ((*em).bx() == 0)
141  {
142  unsigned short n_emcands = 0;
143  //std::cout << std::endl << "rank: " << (*em).rank() ;
144 
145  if ((*em).rank() > 0)
146  {
147  h_emRank->Fill( (*em).rank() );
148  h_emIeta->Fill( (*em).regionId().ieta() );
149  h_emIphi->Fill( (*em).regionId().iphi() );
150  h_emIso->Fill( (*em).isolated() );
151  h_emRankInIetaIphi->Fill( (*em).regionId().ieta(),
152  (*em).regionId().iphi(),
153  (*em).rank() );
154  if ((*em).isolated())
155  {
156  h_emIsoInIetaIphi->Fill( (*em).regionId().ieta(),
157  (*em).regionId().iphi() );
158  }
159  else
160  {
161  h_emNonIsoInIetaIphi->Fill( (*em).regionId().ieta(),
162  (*em).regionId().iphi() );
163  }
164  }
165 
166  if (showEmCands)
167  {
168  if ((*em).rank() > 0)
169  {
170  std::cout << std::endl << "rank: " << (*em).rank();
171  unsigned short rgnPhi = 999;
172  unsigned short rgn = (unsigned short) (*em).rctRegion();
173  unsigned short card = (unsigned short) (*em).rctCard();
174  unsigned short crate = (unsigned short) (*em).rctCrate();
175 
176  if (card == 6)
177  {
178  rgnPhi = rgn;
179  }
180  else if (card < 6)
181  {
182  rgnPhi = (card % 2);
183  }
184  else
185  {
186  std::cout << "rgnPhi not assigned (still " << rgnPhi << ") -- Weird card number! " << card ;
187  }
188  unsigned short phi_bin = ((crate % 9) * 2) + rgnPhi;
189  short eta_bin = (card/2) * 2 + 1;
190  if (card < 6)
191  {
192  eta_bin = eta_bin + rgn;
193  }
194  if (crate < 9)
195  {
196  eta_bin = -eta_bin;
197  }
198  n_emcands++;
199 
200  std::cout << /* "rank: " << (*em).rank() << */ " eta_bin: " << eta_bin << " phi_bin: " << phi_bin << ". crate: " << crate << " card: " << card << " region: " << rgn << ". isolated: " << (*em).isolated();
201  }
202  }
203  }
204  else
205  {
206  h_emRankOutOfTime->Fill( (*em).rank() );
207  }
208  }
209  if(showEmCands)
210  {
211  std::cout << std::endl;
212  }
213 
214  if(showRegionSums)
215  {
216  std::cout << "Regions" << std::endl;
217  }
218  for (rgn=rctRegions->begin(); rgn!=rctRegions->end(); rgn++)
219  {
220  if ((*rgn).bx() == 0)
221  {
222  if(showRegionSums&&(*rgn).et()>0)
223  {
224  std::cout << /* "(Analyzer)\n" << */ (*rgn) << std::endl;
225  }
226  if ( (*rgn).et() > 0 )
227  {
228  h_regionSum->Fill( (*rgn).et() );
229  h_regionIeta->Fill( (*rgn).gctEta() );
230  h_regionIphi->Fill( (*rgn).gctPhi() );
231  h_regionSumInIetaIphi->Fill( (*rgn).gctEta(), (*rgn).gctPhi(),
232  (*rgn).et() );
233  h_regionFGInIetaIphi->Fill( (*rgn).gctEta(), (*rgn).gctPhi(),
234  (*rgn).fineGrain() );
235  }
236  h_regionMip->Fill( (*rgn).mip() );
237  }
238  }
239  if(showRegionSums)
240  {
241  std::cout << std::endl;
242  }
243 
244 }
std::vector< T >::const_iterator const_iterator
edm::InputTag rctDigisLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
edm::InputTag hcalDigisLabel
edm::InputTag ecalDigisLabel
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

edm::InputTag L1RCTTestAnalyzer::ecalDigisLabel
private

Definition at line 59 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

TH1F* L1RCTTestAnalyzer::h_ecalTimeSample
private

Definition at line 85 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emCandTimeSample
private

Definition at line 72 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emIeta
private

Definition at line 65 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emIphi
private

Definition at line 66 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emIso
private

Definition at line 67 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH2F* L1RCTTestAnalyzer::h_emIsoInIetaIphi
private

Definition at line 70 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH2F* L1RCTTestAnalyzer::h_emNonIsoInIetaIphi
private

Definition at line 71 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emRank
private

Definition at line 63 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH2F* L1RCTTestAnalyzer::h_emRankInIetaIphi
private

Definition at line 68 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_emRankOutOfTime
private

Definition at line 64 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_hcalTimeSample
private

Definition at line 86 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH2F* L1RCTTestAnalyzer::h_regionFGInIetaIphi
private

Definition at line 81 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_regionIeta
private

Definition at line 75 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_regionIphi
private

Definition at line 76 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_regionMip
private

Definition at line 77 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_regionSum
private

Definition at line 74 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH2F* L1RCTTestAnalyzer::h_regionSumInIetaIphi
private

Definition at line 78 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

TH1F* L1RCTTestAnalyzer::h_towerMip
private

Definition at line 83 of file L1RCTTestAnalyzer.h.

Referenced by analyze(), and L1RCTTestAnalyzer().

edm::InputTag L1RCTTestAnalyzer::hcalDigisLabel
private

Definition at line 60 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

std::string L1RCTTestAnalyzer::m_HepMCProduct
private

Definition at line 56 of file L1RCTTestAnalyzer.h.

edm::InputTag L1RCTTestAnalyzer::rctDigisLabel
private

Definition at line 61 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

bool L1RCTTestAnalyzer::showEmCands
private

Definition at line 57 of file L1RCTTestAnalyzer.h.

Referenced by analyze().

bool L1RCTTestAnalyzer::showRegionSums
private

Definition at line 58 of file L1RCTTestAnalyzer.h.

Referenced by analyze().