#include <HiggsValidation.h>
Definition at line 38 of file HiggsValidation.h.
HiggsValidation::HiggsValidation | ( | const edm::ParameterSet & | iPSet | ) | [explicit] |
Definition at line 23 of file HiggsValidation.cc.
References dbe, monitoredDecays, and cppFunctionSkipper::operator.
: _wmanager(iPSet), hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection")), particle_id(iPSet.getParameter<int>("pdg_id")), particle_name(iPSet.getParameter<std::string>("particleName")) { dbe = 0; dbe = edm::Service<DQMStore>().operator->(); monitoredDecays = new MonitoredDecays(iPSet); }
HiggsValidation::~HiggsValidation | ( | ) | [virtual] |
Definition at line 36 of file HiggsValidation.cc.
{}
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, CommonMethods::weight(), and WeightManager::weight().
{ double weight = _wmanager.weight(iEvent); nEvt->Fill(0.5,weight); //Gathering the HepMCProduct information edm::Handle<HepMCProduct> evt; iEvent.getByLabel(hepmcCollection_, evt); //Get EVENT HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent())); // loop over all particles bool filled = false; for(HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin(); iter!= myGenEvent->particles_end() && !filled; ++iter) { if(particle_id == fabs((*iter)->pdg_id())){ std::vector<HepMC::GenParticle*> decayprod; int channel = findHiggsDecayChannel(*iter,decayprod); HiggsDecayChannels->Fill(channel,weight); Higgs_pt->Fill((*iter)->momentum().perp(),weight); Higgs_eta->Fill((*iter)->momentum().eta(),weight); Higgs_mass->Fill((*iter)->momentum().m(),weight); for(unsigned int i=0;i<decayprod.size();i++){ int idx=monitoredDecays->isDecayParticle(decayprod.at(i)->pdg_id()); if(0<=idx && idx<=(int)HiggsDecayProd_pt.size()){ HiggsDecayProd_pt.at(idx)->Fill(decayprod.at(i)->momentum().perp(),weight); HiggsDecayProd_eta.at(idx)->Fill(decayprod.at(i)->momentum().eta(),weight); } } filled = true; } } delete myGenEvent; }//analyze
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().
{ if(dbe){ TString dir="Generator/"; dir+=particle_name; dbe->setCurrentFolder(dir.Data()); // Number of analyzed events nEvt = dbe->book1D("nEvt", "n analyzed Events", 1, 0., 1.); //decay type std::string channel = particle_name+"_DecayChannels"; HiggsDecayChannels = dbe->book1D(channel.c_str(),(particle_name+" decay channels").c_str(),monitoredDecays->size(),0,monitoredDecays->size()); for(size_t i = 0; i < monitoredDecays->size(); ++i){ HiggsDecayChannels->setBinLabel(1+i,monitoredDecays->channel(i)); } } //Kinematics Higgs_pt = dbe->book1D((particle_name+"_pt"),(particle_name+" p_{t}"),50,0,250); Higgs_eta = dbe->book1D((particle_name+"_eta"),(particle_name+" #eta"),50,-5,5); Higgs_mass = dbe->book1D((particle_name+"_m"),(particle_name+" M"),500,0,500); int idx=0; for(unsigned int i=0;i<monitoredDecays->NDecayParticles();i++){ HiggsDecayProd_pt.push_back(dbe->book1D((monitoredDecays->ConvertIndex(idx)+"_pt"),(monitoredDecays->ConvertIndex(idx)+" p_{t}"),50,0,250)); HiggsDecayProd_eta.push_back(dbe->book1D((monitoredDecays->ConvertIndex(idx)+"_eta"),(monitoredDecays->ConvertIndex(idx)+" #eta"),50,-5,5)); idx++; } return; }
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().
std::string HiggsValidation::convert | ( | int | ) | [private] |
void HiggsValidation::endJob | ( | void | ) | [virtual] |
void HiggsValidation::endRun | ( | const edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
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().
{ if(genParticle->status() == 1) return monitoredDecays->stable(); std::vector<int> children; if ( genParticle->end_vertex() ) { HepMC::GenVertex::particle_iterator des; for(des = genParticle->end_vertex()->particles_begin(HepMC::descendants); des!= genParticle->end_vertex()->particles_end(HepMC::descendants);++des ) { if((*des)->pdg_id() == genParticle->pdg_id()) continue; HepMC::GenVertex::particle_iterator mother = (*des)->production_vertex()->particles_begin(HepMC::parents); if((*mother)->pdg_id() == genParticle->pdg_id()){ children.push_back((*des)->pdg_id()); decayprod.push_back((*des)); } } } if(children.size() == 2 && children.at(0) != 0 && children.at(1) != 0) return monitoredDecays->position(children.at(0),children.at(1)); return monitoredDecays->undetermined(); }
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().
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().
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().