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

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

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

Private Attributes

WeightManager _wmanager
 
DQMStoredbe
 ME's "container". More...
 
edm::ESHandle
< HepPDT::ParticleDataTable
fPDGTable
 PDT table. More...
 
edm::InputTag hepmcCollection_
 
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
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 38 of file HiggsValidation.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file HiggsValidation.cc.

References dbe, monitoredDecays, and cppFunctionSkipper::operator.

23  :
24  _wmanager(iPSet),
25  hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection")),
26  particle_id(iPSet.getParameter<int>("pdg_id")),
27  particle_name(iPSet.getParameter<std::string>("particleName"))
28 {
29  dbe = 0;
31 
32  monitoredDecays = new MonitoredDecays(iPSet);
33 
34 }
T getParameter(std::string const &) const
WeightManager _wmanager
MonitoredDecays * monitoredDecays
edm::InputTag hepmcCollection_
DQMStore * dbe
ME&#39;s &quot;container&quot;.
std::string particle_name
HiggsValidation::~HiggsValidation ( )
virtual

Definition at line 36 of file HiggsValidation.cc.

36 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 85 of file HiggsValidation.cc.

References _wmanager, MonitorElement::Fill(), findHiggsDecayChannel(), edm::Event::getByLabel(), hepmcCollection_, Higgs_eta, Higgs_mass, Higgs_pt, HiggsDecayChannels, HiggsDecayProd_eta, HiggsDecayProd_pt, i, HiggsValidation::MonitoredDecays::isDecayParticle(), monitoredDecays, nEvt, particle_id, WeightManager::weight(), and CommonMethods::weight().

86 {
87  double weight = _wmanager.weight(iEvent);
88  nEvt->Fill(0.5,weight);
89 
90  //Gathering the HepMCProduct information
92  iEvent.getByLabel(hepmcCollection_, evt);
93 
94  //Get EVENT
95  HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
96 
97  // loop over all particles
98  bool filled = false;
99  for(HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin();
100  iter!= myGenEvent->particles_end() && !filled; ++iter) {
101  if(particle_id == fabs((*iter)->pdg_id())){
102  std::vector<HepMC::GenParticle*> decayprod;
103  int channel = findHiggsDecayChannel(*iter,decayprod);
104  HiggsDecayChannels->Fill(channel,weight);
105  Higgs_pt->Fill((*iter)->momentum().perp(),weight);
106  Higgs_eta->Fill((*iter)->momentum().eta(),weight);
107  Higgs_mass->Fill((*iter)->momentum().m(),weight);
108  for(unsigned int i=0;i<decayprod.size();i++){
109  int idx=monitoredDecays->isDecayParticle(decayprod.at(i)->pdg_id());
110  if(0<=idx && idx<=(int)HiggsDecayProd_pt.size()){
111  HiggsDecayProd_pt.at(idx)->Fill(decayprod.at(i)->momentum().perp(),weight);
112  HiggsDecayProd_eta.at(idx)->Fill(decayprod.at(i)->momentum().eta(),weight);
113  }
114  }
115  filled = true;
116  }
117  }
118 
119  delete myGenEvent;
120 
121 }//analyze
int i
Definition: DBlmapReader.cc:9
MonitorElement * Higgs_eta
WeightManager _wmanager
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
MonitorElement * Higgs_pt
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * HiggsDecayChannels
edm::InputTag hepmcCollection_
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 38 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, monitoredDecays, HiggsValidation::MonitoredDecays::NDecayParticles(), nEvt, particle_name, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and HiggsValidation::MonitoredDecays::size().

39 {
40  if(dbe){
42  TString dir="Generator/";
43  dir+=particle_name;
44  dbe->setCurrentFolder(dir.Data());
45 
46  // Number of analyzed events
47  nEvt = dbe->book1D("nEvt", "n analyzed Events", 1, 0., 1.);
48 
49  //decay type
50 
51  std::string channel = particle_name+"_DecayChannels";
52  HiggsDecayChannels = dbe->book1D(channel.c_str(),(particle_name+" decay channels").c_str(),monitoredDecays->size(),0,monitoredDecays->size());
53 
54  for(size_t i = 0; i < monitoredDecays->size(); ++i){
56  }
57  }
58 
59  //Kinematics
60  Higgs_pt = dbe->book1D((particle_name+"_pt"),(particle_name+" p_{t}"),50,0,250);
61  Higgs_eta = dbe->book1D((particle_name+"_eta"),(particle_name+" #eta"),50,-5,5);
62  Higgs_mass = dbe->book1D((particle_name+"_m"),(particle_name+" M"),500,0,500);
63 
64  int idx=0;
65  for(unsigned int i=0;i<monitoredDecays->NDecayParticles();i++){
66  HiggsDecayProd_pt.push_back(dbe->book1D((monitoredDecays->ConvertIndex(idx)+"_pt"),(monitoredDecays->ConvertIndex(idx)+" p_{t}"),50,0,250));
67  HiggsDecayProd_eta.push_back(dbe->book1D((monitoredDecays->ConvertIndex(idx)+"_eta"),(monitoredDecays->ConvertIndex(idx)+" #eta"),50,-5,5));
68  idx++;
69  }
70 
71  return;
72 }
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:717
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
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:429
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 78 of file HiggsValidation.cc.

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

79 {
81  iSetup.getData( fPDGTable );
82  return;
83 }
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 74 of file HiggsValidation.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file HiggsValidation.cc.

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

Definition at line 123 of file HiggsValidation.cc.

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

Referenced by analyze().

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

Member Data Documentation

WeightManager HiggsValidation::_wmanager
private

Definition at line 160 of file HiggsValidation.h.

Referenced by analyze().

DQMStore* HiggsValidation::dbe
private

ME's "container".

Definition at line 173 of file HiggsValidation.h.

Referenced by beginJob(), and HiggsValidation().

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

PDT table.

Definition at line 170 of file HiggsValidation.h.

Referenced by beginRun().

edm::InputTag HiggsValidation::hepmcCollection_
private

Definition at line 162 of file HiggsValidation.h.

Referenced by analyze().

MonitorElement* HiggsValidation::Higgs_eta
private

Definition at line 179 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* HiggsValidation::Higgs_mass
private

Definition at line 180 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* HiggsValidation::Higgs_pt
private

Definition at line 178 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitorElement* HiggsValidation::HiggsDecayChannels
private

Definition at line 176 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

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

Definition at line 183 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

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

Definition at line 182 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

MonitoredDecays* HiggsValidation::monitoredDecays
private

Definition at line 167 of file HiggsValidation.h.

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

MonitorElement* HiggsValidation::nEvt
private

Definition at line 175 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

int HiggsValidation::particle_id
private

Definition at line 164 of file HiggsValidation.h.

Referenced by analyze().

std::string HiggsValidation::particle_name
private

Definition at line 165 of file HiggsValidation.h.

Referenced by beginJob().