CMS 3D CMS Logo

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

#include <HiggsValidation.h>

Inheritance diagram for HiggsValidation:
edm::EDAnalyzer edm::EDConsumerBase

Classes

class  MonitoredDecays
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 HiggsValidation (const edm::ParameterSet &)
 
virtual ~HiggsValidation ()
 
- 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
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

std::string convert (int)
 
int findHiggsDecayChannel (const HepMC::GenParticle *, std::vector< HepMC::GenParticle * > &decayprod)
 

Private Attributes

DQMStoredbe
 ME's "container". More...
 
edm::ESHandle
< HepPDT::ParticleDataTable
fPDGTable
 PDT table. More...
 
edm::InputTag hepmcCollection_
 
edm::EDGetTokenT
< edm::HepMCProduct
hepmcCollectionToken_
 
MonitorElementHiggs_eta
 
MonitorElementHiggs_mass
 
MonitorElementHiggs_pt
 
MonitorElementHiggsDecayChannels
 
std::vector< MonitorElement * > HiggsDecayProd_eta
 
std::vector< MonitorElement * > HiggsDecayProd_pt
 
MonitoredDecaysmonitoredDecays
 
MonitorElementnEvt
 
int particle_id
 
std::string particle_name
 
WeightManager wmanager_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 36 of file HiggsValidation.h.

Constructor & Destructor Documentation

HiggsValidation::HiggsValidation ( const edm::ParameterSet iPSet)
explicit

Definition at line 21 of file HiggsValidation.cc.

References dbe, hepmcCollection_, hepmcCollectionToken_, monitoredDecays, and cppFunctionSkipper::operator.

21  :
23  hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection")),
24  particle_id(iPSet.getParameter<int>("pdg_id")),
25  particle_name(iPSet.getParameter<std::string>("particleName"))
26 {
27  dbe = 0;
29 
30  monitoredDecays = new MonitoredDecays(iPSet);
31 
32  hepmcCollectionToken_=consumes<HepMCProduct>(hepmcCollection_);
33 }
T getParameter(std::string const &) const
MonitoredDecays * monitoredDecays
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
edm::InputTag hepmcCollection_
DQMStore * dbe
ME&#39;s &quot;container&quot;.
WeightManager wmanager_
std::string particle_name
HiggsValidation::~HiggsValidation ( )
virtual

Definition at line 35 of file HiggsValidation.cc.

35 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 84 of file HiggsValidation.cc.

References MonitorElement::Fill(), findHiggsDecayChannel(), edm::Event::getByToken(), hepmcCollectionToken_, Higgs_eta, Higgs_mass, Higgs_pt, HiggsDecayChannels, HiggsDecayProd_eta, HiggsDecayProd_pt, i, customizeTrackingMonitorSeedNumber::idx, HiggsValidation::MonitoredDecays::isDecayParticle(), monitoredDecays, nEvt, particle_id, WeightManager::weight(), histoStyle::weight, and wmanager_.

85 {
86  double weight = wmanager_.weight(iEvent);
87  nEvt->Fill(0.5,weight);
88 
89  //Gathering the HepMCProduct information
91  iEvent.getByToken(hepmcCollectionToken_, evt);
92 
93  //Get EVENT
94  HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
95 
96  // loop over all particles
97  bool filled = false;
98  for(HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin();
99  iter!= myGenEvent->particles_end() && !filled; ++iter) {
100  if(particle_id == fabs((*iter)->pdg_id())){
101  std::vector<HepMC::GenParticle*> decayprod;
102  int channel = findHiggsDecayChannel(*iter,decayprod);
103  HiggsDecayChannels->Fill(channel,weight);
104  Higgs_pt->Fill((*iter)->momentum().perp(),weight);
105  Higgs_eta->Fill((*iter)->momentum().eta(),weight);
106  Higgs_mass->Fill((*iter)->momentum().m(),weight);
107  for(unsigned int i=0;i<decayprod.size();i++){
108  int idx=monitoredDecays->isDecayParticle(decayprod.at(i)->pdg_id());
109  if(0<=idx && idx<=(int)HiggsDecayProd_pt.size()){
110  HiggsDecayProd_pt.at(idx)->Fill(decayprod.at(i)->momentum().perp(),weight);
111  HiggsDecayProd_eta.at(idx)->Fill(decayprod.at(i)->momentum().eta(),weight);
112  }
113  }
114  filled = true;
115  }
116  }
117 
118  delete myGenEvent;
119 
120 }//analyze
int i
Definition: DBlmapReader.cc:9
MonitorElement * Higgs_eta
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * nEvt
std::vector< MonitorElement * > HiggsDecayProd_pt
MonitoredDecays * monitoredDecays
void Fill(long long x)
int findHiggsDecayChannel(const HepMC::GenParticle *, std::vector< HepMC::GenParticle * > &decayprod)
std::vector< MonitorElement * > HiggsDecayProd_eta
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
MonitorElement * Higgs_pt
MonitorElement * HiggsDecayChannels
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
WeightManager wmanager_
int weight
Definition: histoStyle.py:50
double weight(const edm::Event &)
MonitorElement * Higgs_mass
void HiggsValidation::beginJob ( void  )
virtual

Setting the DQM top directories

Reimplemented from edm::EDAnalyzer.

Definition at line 37 of file HiggsValidation.cc.

References DQMStore::book1D(), HiggsValidation::MonitoredDecays::channel(), HiggsValidation::MonitoredDecays::ConvertIndex(), dbe, dir, Higgs_eta, Higgs_mass, Higgs_pt, HiggsDecayChannels, HiggsDecayProd_eta, HiggsDecayProd_pt, i, customizeTrackingMonitorSeedNumber::idx, monitoredDecays, HiggsValidation::MonitoredDecays::NDecayParticles(), nEvt, particle_name, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), HiggsValidation::MonitoredDecays::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

38 {
39  if(dbe){
41  TString dir="Generator/";
42  dir+=particle_name;
43  dbe->setCurrentFolder(dir.Data());
44 
45  // Number of analyzed events
46  nEvt = dbe->book1D("nEvt", "n analyzed Events", 1, 0., 1.);
47 
48  //decay type
49 
50  std::string channel = particle_name+"_DecayChannels";
51  HiggsDecayChannels = dbe->book1D(channel.c_str(),(particle_name+" decay channels").c_str(),monitoredDecays->size(),0,monitoredDecays->size());
52 
53  for(size_t i = 0; i < monitoredDecays->size(); ++i){
55  }
56  }
57 
58  //Kinematics
59  Higgs_pt = dbe->book1D((particle_name+"_pt"),(particle_name+" p_{t}"),50,0,250);
60  Higgs_eta = dbe->book1D((particle_name+"_eta"),(particle_name+" #eta"),50,-5,5);
61  Higgs_mass = dbe->book1D((particle_name+"_m"),(particle_name+" M"),500,0,500);
62 
63  int idx=0;
64  for(unsigned int i=0;i<monitoredDecays->NDecayParticles();i++){
65  HiggsDecayProd_pt.push_back(dbe->book1D((monitoredDecays->ConvertIndex(idx)+"_pt"),(monitoredDecays->ConvertIndex(idx)+" p_{t}"),50,0,250));
66  HiggsDecayProd_eta.push_back(dbe->book1D((monitoredDecays->ConvertIndex(idx)+"_eta"),(monitoredDecays->ConvertIndex(idx)+" #eta"),50,-5,5));
67  idx++;
68  }
69 
70  return;
71 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * Higgs_eta
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * nEvt
std::vector< MonitorElement * > HiggsDecayProd_pt
MonitoredDecays * monitoredDecays
std::vector< MonitorElement * > HiggsDecayProd_eta
MonitorElement * Higgs_pt
MonitorElement * HiggsDecayChannels
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
DQMStore * dbe
ME&#39;s &quot;container&quot;.
std::string ConvertIndex(int index)
std::string channel(size_t i)
dbl *** dir
Definition: mlp_gen.cc:35
std::string particle_name
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * Higgs_mass
void HiggsValidation::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Get PDT Table

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file HiggsValidation.cc.

References fPDGTable, and edm::EventSetup::getData().

78 {
80  iSetup.getData( fPDGTable );
81  return;
82 }
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
PDT table.
void getData(T &iHolder) const
Definition: EventSetup.h:67
std::string HiggsValidation::convert ( int  )
private
void HiggsValidation::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 73 of file HiggsValidation.cc.

73  {
74  return;
75 }
void HiggsValidation::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file HiggsValidation.cc.

83 {return;}
int HiggsValidation::findHiggsDecayChannel ( const HepMC::GenParticle *  genParticle,
std::vector< HepMC::GenParticle * > &  decayprod 
)
private

Definition at line 122 of file HiggsValidation.cc.

References monitoredDecays, parents, HiggsValidation::MonitoredDecays::position(), HiggsValidation::MonitoredDecays::stable(), and HiggsValidation::MonitoredDecays::undetermined().

Referenced by analyze().

122  {
123  if(genParticle->status() == 1) return monitoredDecays->stable();
124  std::vector<int> children;
125  if ( genParticle->end_vertex() ) {
126  HepMC::GenVertex::particle_iterator des;
127  for(des = genParticle->end_vertex()->particles_begin(HepMC::descendants);
128  des!= genParticle->end_vertex()->particles_end(HepMC::descendants);++des ) {
129 
130  if((*des)->pdg_id() == genParticle->pdg_id()) continue;
131 
132  HepMC::GenVertex::particle_iterator mother = (*des)->production_vertex()->particles_begin(HepMC::parents);
133  if((*mother)->pdg_id() == genParticle->pdg_id()){
134  children.push_back((*des)->pdg_id());
135  decayprod.push_back((*des));
136  }
137  }
138  }
139 
140  if(children.size() == 2 && children.at(0) != 0 && children.at(1) != 0){
141  return monitoredDecays->position(children.at(0),children.at(1));
142  }
143  return monitoredDecays->undetermined();
144 }
TPRegexp parents
Definition: eve_filter.cc:24
size_t position(int pid1, int pid2)
MonitoredDecays * monitoredDecays

Member Data Documentation

DQMStore* HiggsValidation::dbe
private

ME's "container".

Definition at line 169 of file HiggsValidation.h.

Referenced by beginJob(), and HiggsValidation().

edm::ESHandle<HepPDT::ParticleDataTable> HiggsValidation::fPDGTable
private

PDT table.

Definition at line 166 of file HiggsValidation.h.

Referenced by beginRun().

edm::InputTag HiggsValidation::hepmcCollection_
private

Definition at line 158 of file HiggsValidation.h.

Referenced by HiggsValidation().

edm::EDGetTokenT<edm::HepMCProduct> HiggsValidation::hepmcCollectionToken_
private

Definition at line 181 of file HiggsValidation.h.

Referenced by analyze(), and HiggsValidation().

MonitorElement* HiggsValidation::Higgs_eta
private

Definition at line 175 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* HiggsValidation::Higgs_mass
private

Definition at line 176 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* HiggsValidation::Higgs_pt
private

Definition at line 174 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* HiggsValidation::HiggsDecayChannels
private

Definition at line 172 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

std::vector<MonitorElement*> HiggsValidation::HiggsDecayProd_eta
private

Definition at line 179 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

std::vector<MonitorElement*> HiggsValidation::HiggsDecayProd_pt
private

Definition at line 178 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitoredDecays* HiggsValidation::monitoredDecays
private

Definition at line 163 of file HiggsValidation.h.

Referenced by analyze(), beginJob(), findHiggsDecayChannel(), and HiggsValidation().

MonitorElement* HiggsValidation::nEvt
private

Definition at line 171 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

int HiggsValidation::particle_id
private

Definition at line 160 of file HiggsValidation.h.

Referenced by analyze().

std::string HiggsValidation::particle_name
private

Definition at line 161 of file HiggsValidation.h.

Referenced by beginJob().

WeightManager HiggsValidation::wmanager_
private

Definition at line 47 of file HiggsValidation.h.

Referenced by analyze().