CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

HiggsValidation Class Reference

#include <HiggsValidation.h>

Inheritance diagram for HiggsValidation:
edm::EDAnalyzer

List of all members.

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 ()

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".
edm::ESHandle
< HepPDT::ParticleDataTable
fPDGTable
 PDT table.
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

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.

                                                            : 
  _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.

{}

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, 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().

{
  iSetup.getData( fPDGTable );
  return;
}
std::string HiggsValidation::convert ( int  ) [private]
void HiggsValidation::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 74 of file HiggsValidation.cc.

                            {
  return;
}
void HiggsValidation::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file HiggsValidation.cc.

{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().

                                                                                                                     {
  
  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();
}

Member Data Documentation

Definition at line 160 of file HiggsValidation.h.

Referenced by analyze().

ME's "container".

Definition at line 173 of file HiggsValidation.h.

Referenced by beginJob(), and HiggsValidation().

PDT table.

Definition at line 170 of file HiggsValidation.h.

Referenced by beginRun().

Definition at line 162 of file HiggsValidation.h.

Referenced by analyze().

Definition at line 179 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

Definition at line 180 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

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().

Definition at line 183 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

Definition at line 182 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

Definition at line 167 of file HiggsValidation.h.

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

Definition at line 175 of file HiggsValidation.h.

Referenced by analyze(), and beginJob().

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().