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
cms::ProducerAnalyzer Class Reference

#include <ProducerAnalyzer.h>

Inheritance diagram for cms::ProducerAnalyzer:
edm::EDAnalyzer

Public Member Functions

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

Private Attributes

std::string ecalInput_
 
std::string gammaClus_
 
std::string hbheInput_
 
std::string hfInput_
 
std::string hoInput_
 
std::string jetCalo_
 
std::string nameProd_
 
std::string Tracks_
 

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

Definition at line 31 of file ProducerAnalyzer.h.

Constructor & Destructor Documentation

cms::ProducerAnalyzer::ProducerAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 37 of file ProducerAnalyzer.cc.

References edm::ParameterSet::getUntrackedParameter().

38 {
39  // get name of output file with histogramms
40 
41  nameProd_ = iConfig.getUntrackedParameter<std::string>("nameProd");
42  jetCalo_ = iConfig.getUntrackedParameter<std::string>("jetCalo","GammaJetJetBackToBackCollection");
43  gammaClus_ = iConfig.getUntrackedParameter<std::string>("gammaClus","GammaJetGammaBackToBackCollection");
44  ecalInput_=iConfig.getUntrackedParameter<std::string>("ecalInput","GammaJetEcalRecHitCollection");
45  hbheInput_ = iConfig.getUntrackedParameter<std::string>("hbheInput");
46  hoInput_ = iConfig.getUntrackedParameter<std::string>("hoInput");
47  hfInput_ = iConfig.getUntrackedParameter<std::string>("hfInput");
48  Tracks_ = iConfig.getUntrackedParameter<std::string>("Tracks","GammaJetTracksCollection");
49 
50 }
T getUntrackedParameter(std::string const &, T const &) const
cms::ProducerAnalyzer::~ProducerAnalyzer ( )

Definition at line 52 of file ProducerAnalyzer.cc.

53 {
54 
55  // do anything here that needs to be done at desctruction time
56  // (e.g. close files, deallocate resources etc.)
57 
58 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 75 of file ProducerAnalyzer.cc.

References begin, gather_cfg::cout, patCandidatesForDimuonsSequences_cff::ecal, end, spr::energyECAL(), spr::energyHCAL(), PV3DBase< T, PVType, FrameType >::eta(), edm::EventSetup::get(), edm::Event::getAllProvenance(), edm::Event::getByLabel(), metsig::jet, analyzePatCleaning_cfg::jets, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), findQualityFiles::size, and testEve_cfg::tracks.

76 {
77 
78  using namespace edm;
79 
80  const CaloGeometry* geo;
82  iSetup.get<CaloGeometryRecord>().get(pG);
83  geo = pG.product();
84 
85 
86  std::vector<Provenance const*> theProvenance;
87  iEvent.getAllProvenance(theProvenance);
88  for( std::vector<Provenance const*>::const_iterator ip = theProvenance.begin();
89  ip != theProvenance.end(); ip++)
90  {
91  cout<<" Print all module/label names "<<(**ip).moduleName()<<" "<<(**ip).moduleLabel()<<
92  " "<<(**ip).productInstanceName()<<endl;
93  }
94 
95 
96  if(nameProd_ == "hoCalibProducer")
97  {
99  iEvent.getByLabel(nameProd_,hoInput_, ho);
100  const HOCalibVariableCollection Hitho = *(ho.product());
101  std::cout<<" Size of HO "<<(Hitho).size()<<std::endl;
102  }
103 
104  if(nameProd_ == "ALCARECOMuAlZMuMu" )
105  {
106 
108  iEvent.getByLabel("horeco", ho);
109  const HORecHitCollection Hitho = *(ho.product());
110  std::cout<<" Size of HO "<<(Hitho).size()<<std::endl;
112  iEvent.getByLabel(nameProd_,"SelectedMuons", mucand);
113  std::cout<<" Size of muon collection "<<mucand->size()<<std::endl;
114  for(MuonCollection::const_iterator it = mucand->begin(); it != mucand->end(); it++)
115  {
116  TrackRef mu = (*it).combinedMuon();
117  std::cout<<" Pt muon "<<mu->innerMomentum()<<std::endl;
118  }
119 
120  }
121 
122  if(nameProd_ != "IsoProd" && nameProd_ != "ALCARECOMuAlZMuMu" && nameProd_ != "hoCalibProducer")
123  {
125  iEvent.getByLabel(hbheInput_, hbhe);
126  const HBHERecHitCollection Hithbhe = *(hbhe.product());
127  std::cout<<" Size of HBHE "<<(Hithbhe).size()<<std::endl;
128 
129 
131  iEvent.getByLabel(hoInput_, ho);
132  const HORecHitCollection Hitho = *(ho.product());
133  std::cout<<" Size of HO "<<(Hitho).size()<<std::endl;
134 
135 
137  iEvent.getByLabel(hfInput_, hf);
138  const HFRecHitCollection Hithf = *(hf.product());
139  std::cout<<" Size of HF "<<(Hithf).size()<<std::endl;
140  }
141  if(nameProd_ == "IsoProd")
142  {
143  cout<<" We are here "<<endl;
145  iEvent.getByLabel(nameProd_,Tracks_,tracks);
146 
147 
148  std::cout<<" Tracks size "<<(*tracks).size()<<std::endl;
149  reco::TrackCollection::const_iterator track = tracks->begin ();
150 
151  for (; track != tracks->end (); track++)
152  {
153  cout<<" P track "<<(*track).p()<<" eta "<<(*track).eta()<<" phi "<<(*track).phi()<<" Outer "<<(*track).outerMomentum()<<" "<<
154  (*track).outerPosition()<<endl;
155  TrackExtraRef myextra = (*track).extra();
156  cout<<" Track extra "<<myextra->outerMomentum()<<" "<<myextra->outerPosition()<<endl;
157  }
158 
160  iEvent.getByLabel(nameProd_,ecalInput_,ecal);
161  const EcalRecHitCollection Hitecal = *(ecal.product());
162  std::cout<<" Size of Ecal "<<(Hitecal).size()<<std::endl;
164 
165  double energyECAL = 0.;
166  double energyHCAL = 0.;
167 
168  for (; hite != (ecal.product())->end (); hite++)
169  {
170 
171 // cout<<" Energy ECAL "<<(*hite).energy()<<endl;
172 
173 
174 // " eta "<<(*hite).detid()<<" phi "<<(*hite).detid().getPosition().phi()<<endl;
175 
176  GlobalPoint posE = geo->getPosition((*hite).detid());
177 
178  cout<<" Energy ECAL "<<(*hite).energy()<<
179  " eta "<<posE.eta()<<" phi "<<posE.phi()<<endl;
180 
181  energyECAL = energyECAL + (*hite).energy();
182 
183  }
184 
186  iEvent.getByLabel(nameProd_,hbheInput_,hbhe);
187  const HBHERecHitCollection Hithbhe = *(hbhe.product());
188  std::cout<<" Size of HBHE "<<(Hithbhe).size()<<std::endl;
190 
191  for (; hith != (hbhe.product())->end (); hith++)
192  {
193 
194  GlobalPoint posH = geo->getPosition((*hith).detid());
195 
196  cout<<" Energy HCAL "<<(*hith).energy()<<
197  " eta "<<posH.eta()<<" phi "<<posH.phi()<<endl;
198 
199  energyHCAL = energyHCAL + (*hith).energy();
200 
201  }
202 
203  cout<<" Energy ECAL "<< energyECAL<<" Energy HCAL "<< energyHCAL<<endl;
204 
206  iEvent.getByLabel(nameProd_,hoInput_,ho);
207  const HORecHitCollection Hitho = *(ho.product());
208  std::cout<<" Size of HO "<<(Hitho).size()<<std::endl;
210 
211  for (; hito != (ho.product())->end (); hito++)
212  {
213 // cout<<" Energy HO "<<(*hito).energy()<<endl;
214 // " eta "<<(*hite).eta()<<" phi "<<(*hite).phi()<<endl;
215  }
216 
217  }
218 
219 
220  if(nameProd_ == "GammaJetProd" || nameProd_ == "DiJProd")
221  {
222  cout<<" we are in GammaJetProd area "<<endl;
224  iEvent.getByLabel(nameProd_,ecalInput_, ecal);
225  std::cout<<" Size of ECAL "<<(*ecal).size()<<std::endl;
226 
228  iEvent.getByLabel(nameProd_,jetCalo_, jets);
229  std::cout<<" Jet size "<<(*jets).size()<<std::endl;
230  reco::CaloJetCollection::const_iterator jet = jets->begin ();
231  for (; jet != jets->end (); jet++)
232  {
233  cout<<" Et jet "<<(*jet).et()<<" eta "<<(*jet).eta()<<" phi "<<(*jet).phi()<<endl;
234  }
235 
237  iEvent.getByLabel(nameProd_,Tracks_, tracks);
238  std::cout<<" Tracks size "<<(*tracks).size()<<std::endl;
239  }
240  if( nameProd_ == "GammaJetProd")
241  {
243  iEvent.getByLabel(nameProd_,gammaClus_, eclus);
244  std::cout<<" GammaClus size "<<(*eclus).size()<<std::endl;
245  reco::SuperClusterCollection::const_iterator iclus = eclus->begin ();
246  for (; iclus != eclus->end (); iclus++)
247  {
248  cout<<" Et gamma "<<(*iclus).energy()/cosh((*iclus).eta())<<" eta "<<(*iclus).eta()<<" phi "<<(*iclus).phi()<<endl;
249  }
250  }
251 
252 }
double energyHCAL(std::vector< DetId > &vdets, edm::Handle< T > &hits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false)
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:71
double energyECAL(std::vector< DetId > &vdets, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
std::vector< T >::const_iterator const_iterator
#define end
Definition: vmac.h:38
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
tuple tracks
Definition: testEve_cfg.py:39
const T & get() const
Definition: EventSetup.h:55
std::vector< HOCalibVariables > HOCalibVariableCollection
collection of HOcalibration variabale
T const * product() const
Definition: Handle.h:74
T eta() const
Definition: PV3DBase.h:70
#define begin
Definition: vmac.h:31
tuple cout
Definition: gather_cfg.py:41
tuple size
Write out results.
void cms::ProducerAnalyzer::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file ProducerAnalyzer.cc.

61 {
62 }
void cms::ProducerAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file ProducerAnalyzer.cc.

65 {
66 }

Member Data Documentation

std::string cms::ProducerAnalyzer::ecalInput_
private

Definition at line 45 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::gammaClus_
private

Definition at line 44 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::hbheInput_
private

Definition at line 46 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::hfInput_
private

Definition at line 48 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::hoInput_
private

Definition at line 47 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::jetCalo_
private

Definition at line 43 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::nameProd_
private

Definition at line 42 of file ProducerAnalyzer.h.

std::string cms::ProducerAnalyzer::Tracks_
private

Definition at line 49 of file ProducerAnalyzer.h.