CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::ProducerAnalyzer Class Reference

#include <ProducerAnalyzer.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 ProducerAnalyzer (const edm::ParameterSet &)
 
 ~ProducerAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string ecalInput_
 
std::string gammaClus_
 
std::string hbheInput_
 
std::string hfInput_
 
std::string hoInput_
 
std::string jetCalo_
 
std::string nameProd_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_ecal_
 
edm::EDGetTokenT< reco::SuperClusterCollectiontok_gamma_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbhe_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbheProd_
 
edm::EDGetTokenT< HFRecHitCollectiontok_hf_
 
edm::EDGetTokenT< HORecHitCollectiontok_ho_
 
edm::EDGetTokenT< HORecHitCollectiontok_hoProd_
 
edm::EDGetTokenT< HORecHitCollectiontok_horeco_
 
edm::EDGetTokenT< HOCalibVariableCollectiontok_hovar_
 
edm::EDGetTokenT< reco::CaloJetCollectiontok_jets_
 
edm::EDGetTokenT< reco::MuonCollectiontok_muons_
 
edm::EDGetTokenT< reco::TrackCollectiontok_tracks_
 
std::string Tracks_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 43 of file ProducerAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file ProducerAnalyzer.cc.

References edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

28 {
29  // get name of output file with histogramms
30 
31  nameProd_ = iConfig.getUntrackedParameter<std::string>("nameProd");
32  jetCalo_ = iConfig.getUntrackedParameter<std::string>("jetCalo","GammaJetJetBackToBackCollection");
33  gammaClus_ = iConfig.getUntrackedParameter<std::string>("gammaClus","GammaJetGammaBackToBackCollection");
34  ecalInput_=iConfig.getUntrackedParameter<std::string>("ecalInput","GammaJetEcalRecHitCollection");
35  hbheInput_ = iConfig.getUntrackedParameter<std::string>("hbheInput");
36  hoInput_ = iConfig.getUntrackedParameter<std::string>("hoInput");
37  hfInput_ = iConfig.getUntrackedParameter<std::string>("hfInput");
38  Tracks_ = iConfig.getUntrackedParameter<std::string>("Tracks","GammaJetTracksCollection");
39 
40  tok_hovar_ = consumes<HOCalibVariableCollection>( edm::InputTag(nameProd_,hoInput_) );
41  tok_horeco_ = consumes<HORecHitCollection>( edm::InputTag("horeco") );
42  tok_ho_ = consumes<HORecHitCollection>( edm::InputTag(hoInput_) );
43  tok_hoProd_ = consumes<HORecHitCollection>( edm::InputTag(nameProd_,hoInput_) );
44 
45  tok_hf_ = consumes<HFRecHitCollection>( edm::InputTag(hfInput_) );
46 
47  tok_jets_ = consumes<reco::CaloJetCollection>( edm::InputTag(nameProd_,jetCalo_) );
48  tok_gamma_ = consumes<reco::SuperClusterCollection>( edm::InputTag(nameProd_,gammaClus_) );
49  tok_muons_ = consumes<reco::MuonCollection>(edm::InputTag(nameProd_,"SelectedMuons"));
50  tok_ecal_ = consumes<EcalRecHitCollection>( edm::InputTag(nameProd_,ecalInput_) );
51  tok_tracks_ = consumes<reco::TrackCollection>( edm::InputTag(nameProd_,Tracks_) );
52 
53  tok_hbheProd_ = consumes<HBHERecHitCollection>( edm::InputTag(nameProd_,hbheInput_) );
54  tok_hbhe_ = consumes<HBHERecHitCollection>( edm::InputTag(hbheInput_) );
55 
56 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackCollection > tok_tracks_
edm::EDGetTokenT< reco::MuonCollection > tok_muons_
edm::EDGetTokenT< reco::SuperClusterCollection > tok_gamma_
edm::EDGetTokenT< HORecHitCollection > tok_hoProd_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheProd_
edm::EDGetTokenT< HORecHitCollection > tok_horeco_
edm::EDGetTokenT< HOCalibVariableCollection > tok_hovar_
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
cms::ProducerAnalyzer::~ProducerAnalyzer ( )
override

Definition at line 58 of file ProducerAnalyzer.cc.

59 {
60 
61  // do anything here that needs to be done at desctruction time
62  // (e.g. close files, deallocate resources etc.)
63 
64 }

Member Function Documentation

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

Definition at line 81 of file ProducerAnalyzer.cc.

References digitizers_cfi::ecal, spr::energyECAL(), spr::energyHCAL(), PV3DBase< T, PVType, FrameType >::eta(), edm::EventSetup::get(), edm::Event::getAllStableProvenance(), edm::Event::getByToken(), CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, metsig::jet, fwrapper::jets, RPCpg::mu, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), findQualityFiles::size, HiIsolationCommonParameters_cff::track, and l1t::tracks.

82 {
83 
84  using namespace edm;
85 
87  iSetup.get<CaloGeometryRecord>().get(pG);
88  const CaloGeometry* geo = pG.product();
89 
90 
91  std::vector<StableProvenance const*> theProvenance;
92  iEvent.getAllStableProvenance(theProvenance);
93  for(auto const& provenance : theProvenance) {
94  edm::LogVerbatim("HcalAlCa")<<" Print all module/label names "
95  <<provenance->moduleName()
96  <<" "<<provenance->moduleLabel()
97  <<" "<<provenance->productInstanceName();
98  }
99 
100 
101  if(nameProd_ == "hoCalibProducer") {
103  iEvent.getByToken(tok_hovar_, ho);
104  const HOCalibVariableCollection Hitho = *(ho.product());
105  edm::LogVerbatim("HcalAlCa")<<" Size of HO "<<(Hitho).size();
106  }
107 
108  if(nameProd_ == "ALCARECOMuAlZMuMu" ) {
109 
111  iEvent.getByToken(tok_horeco_, ho);
112  const HORecHitCollection Hitho = *(ho.product());
113  edm::LogVerbatim("HcalAlCa")<<" Size of HO "<<(Hitho).size();
115  iEvent.getByToken(tok_muons_, mucand);
116  edm::LogVerbatim("HcalAlCa")<<" Size of muon collection "<<mucand->size();
117  for(const auto & it : *(mucand.product())) {
118  TrackRef mu = it.combinedMuon();
119  edm::LogVerbatim("HcalAlCa")<<" Pt muon "<<mu->innerMomentum();
120  }
121 
122  }
123 
124  if(nameProd_ != "IsoProd" && nameProd_ != "ALCARECOMuAlZMuMu" && nameProd_ != "hoCalibProducer") {
126  iEvent.getByToken(tok_hbhe_, hbhe);
127  const HBHERecHitCollection Hithbhe = *(hbhe.product());
128  edm::LogVerbatim("HcalAlCa")<<" Size of HBHE "<<(Hithbhe).size();
129 
130 
132  iEvent.getByToken(tok_ho_, ho);
133  const HORecHitCollection Hitho = *(ho.product());
134  edm::LogVerbatim("HcalAlCa")<<" Size of HO "<<(Hitho).size();
135 
136 
138  iEvent.getByToken(tok_hf_, hf);
139  const HFRecHitCollection Hithf = *(hf.product());
140  edm::LogVerbatim("HcalAlCa")<<" Size of HF "<<(Hithf).size();
141  }
142  if(nameProd_ == "IsoProd") {
143  edm::LogVerbatim("HcalAlCa")<<" We are here ";
145  iEvent.getByToken(tok_tracks_,tracks);
146 
147 
148  edm::LogVerbatim("HcalAlCa")<<" Tracks size "<<(*tracks).size();
149  for (const auto & track : *(tracks.product())) {
150  edm::LogVerbatim("HcalAlCa")<<" P track "<<track.p()<<" eta "
151  <<track.eta()<<" phi "<<track.phi()
152  <<" Outer "<<track.outerMomentum()
153  <<" "<<track.outerPosition();
154  TrackExtraRef myextra = track.extra();
155  edm::LogVerbatim("HcalAlCa")<<" Track extra "
156  <<myextra->outerMomentum()<<" "
157  <<myextra->outerPosition();
158  }
159 
161  iEvent.getByToken(tok_ecal_,ecal);
162  const EcalRecHitCollection Hitecal = *(ecal.product());
163  edm::LogVerbatim("HcalAlCa")<<" Size of Ecal "<<(Hitecal).size();
164 
165  double energyECAL = 0.;
166  double energyHCAL = 0.;
167 
168  for (const auto & hite : *(ecal.product())) {
169 
170  const GlobalPoint& posE = geo->getPosition(hite.detid());
171 
172  edm::LogVerbatim("HcalAlCa")<<" Energy ECAL "<<hite.energy()
173  <<" eta "<<posE.eta()<<" phi "<<posE.phi();
174 
175  energyECAL = energyECAL + hite.energy();
176 
177  }
178 
180  iEvent.getByToken(tok_hbheProd_,hbhe);
181  const HBHERecHitCollection Hithbhe = *(hbhe.product());
182  edm::LogVerbatim("HcalAlCa")<<" Size of HBHE "<<(Hithbhe).size();
183 
184  for (const auto & hith : *(hbhe.product())) {
185 
186  GlobalPoint posH = (static_cast<const HcalGeometry*>(geo->getSubdetectorGeometry(hith.detid())))->getPosition(hith.detid());
187 
188  edm::LogVerbatim("HcalAlCa")<<" Energy HCAL "<<hith.energy()
189  <<" eta "<<posH.eta()<<" phi "<<posH.phi();
190 
191  energyHCAL = energyHCAL + hith.energy();
192 
193  }
194 
195  edm::LogVerbatim("HcalAlCa")<<" Energy ECAL "<< energyECAL
196  <<" Energy HCAL "<< energyHCAL;
197  }
198 
199 
200  if(nameProd_ == "GammaJetProd" || nameProd_ == "DiJProd") {
201  edm::LogVerbatim("HcalAlCa")<<" we are in GammaJetProd area ";
203  iEvent.getByToken(tok_ecal_, ecal);
204  edm::LogVerbatim("HcalAlCa")<<" Size of ECAL "<<(*ecal).size();
205 
207  iEvent.getByToken(tok_jets_, jets);
208  edm::LogVerbatim("HcalAlCa")<<" Jet size "<<(*jets).size();
209 
210  for (const auto & jet : *(jets.product())) {
211  edm::LogVerbatim("HcalAlCa")<<" Et jet "<<jet.et()<<" eta "<<jet.eta()
212  <<" phi "<<jet.phi();
213  }
214 
216  iEvent.getByToken(tok_tracks_, tracks);
217  edm::LogVerbatim("HcalAlCa")<<" Tracks size "<<(*tracks).size();
218  }
219  if( nameProd_ == "GammaJetProd") {
221  iEvent.getByToken(tok_gamma_, eclus);
222  edm::LogVerbatim("HcalAlCa")<<" GammaClus size "<<(*eclus).size();
223  for (const auto & iclus : *(eclus.product())) {
224  edm::LogVerbatim("HcalAlCa")<<" Et gamma "
225  <<iclus.energy()/cosh(iclus.eta())<<" eta "
226  <<iclus.eta()<<" phi "<<iclus.phi();
227  }
228  }
229 
230 }
size
Write out results.
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:44
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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< reco::TrackCollection > tok_tracks_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
edm::EDGetTokenT< reco::MuonCollection > tok_muons_
edm::EDGetTokenT< reco::SuperClusterCollection > tok_gamma_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbheProd_
vector< PseudoJet > jets
edm::EDGetTokenT< HORecHitCollection > tok_horeco_
edm::EDGetTokenT< HOCalibVariableCollection > tok_hovar_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:69
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
const int mu
Definition: Constants.h:22
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 useRaw=false, bool debug=false)
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:58
std::vector< HOCalibVariables > HOCalibVariableCollection
collection of HOcalibration variabale
T eta() const
Definition: PV3DBase.h:76
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
HLT enums.
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
T const * product() const
Definition: ESHandle.h:86
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Event.cc:144
void cms::ProducerAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 66 of file ProducerAnalyzer.cc.

67 {
68 }
void cms::ProducerAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file ProducerAnalyzer.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

71 {
72 }

Member Data Documentation

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

Definition at line 57 of file ProducerAnalyzer.h.

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

Definition at line 56 of file ProducerAnalyzer.h.

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

Definition at line 58 of file ProducerAnalyzer.h.

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

Definition at line 60 of file ProducerAnalyzer.h.

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

Definition at line 59 of file ProducerAnalyzer.h.

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

Definition at line 55 of file ProducerAnalyzer.h.

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

Definition at line 54 of file ProducerAnalyzer.h.

edm::EDGetTokenT<EcalRecHitCollection> cms::ProducerAnalyzer::tok_ecal_
private

Definition at line 73 of file ProducerAnalyzer.h.

edm::EDGetTokenT<reco::SuperClusterCollection> cms::ProducerAnalyzer::tok_gamma_
private

Definition at line 71 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HBHERecHitCollection> cms::ProducerAnalyzer::tok_hbhe_
private

Definition at line 76 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HBHERecHitCollection> cms::ProducerAnalyzer::tok_hbheProd_
private

Definition at line 77 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HFRecHitCollection> cms::ProducerAnalyzer::tok_hf_
private

Definition at line 68 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HORecHitCollection> cms::ProducerAnalyzer::tok_ho_
private

Definition at line 65 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HORecHitCollection> cms::ProducerAnalyzer::tok_hoProd_
private

Definition at line 66 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HORecHitCollection> cms::ProducerAnalyzer::tok_horeco_
private

Definition at line 64 of file ProducerAnalyzer.h.

edm::EDGetTokenT<HOCalibVariableCollection> cms::ProducerAnalyzer::tok_hovar_
private

Definition at line 63 of file ProducerAnalyzer.h.

edm::EDGetTokenT<reco::CaloJetCollection> cms::ProducerAnalyzer::tok_jets_
private

Definition at line 70 of file ProducerAnalyzer.h.

edm::EDGetTokenT<reco::MuonCollection> cms::ProducerAnalyzer::tok_muons_
private

Definition at line 72 of file ProducerAnalyzer.h.

edm::EDGetTokenT<reco::TrackCollection> cms::ProducerAnalyzer::tok_tracks_
private

Definition at line 74 of file ProducerAnalyzer.h.

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

Definition at line 61 of file ProducerAnalyzer.h.