![]() |
![]() |
#include <RecoMET/METProducers/interface/METProducer.h>
Public Types | |
typedef edm::OwnVector < reco::Candidate > | CandidateCollection |
typedef math::XYZTLorentzVector | LorentzVector |
typedef math::XYZPoint | Point |
Public Member Functions | |
METProducer () | |
METProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
virtual | ~METProducer () |
Private Attributes | |
METAlgo | alg_ |
std::string | alias |
edm::ParameterSet | conf_ |
double | globalThreshold |
edm::InputTag | inputLabel |
std::string | inputType |
std::string | METtype |
bool | noHF |
Definition at line 33 of file METProducer.h.
Definition at line 38 of file METProducer.h.
Definition at line 36 of file METProducer.h.
Definition at line 37 of file METProducer.h.
METProducer::METProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 50 of file METProducer.cc.
References alias, edm::ParameterSet::getParameter(), globalThreshold, inputLabel, inputType, METtype, and noHF.
00050 : conf_(iConfig),alg_() 00051 { 00052 inputLabel = iConfig.getParameter<edm::InputTag>("src"); 00053 inputType = iConfig.getParameter<std::string>("InputType"); 00054 METtype = iConfig.getParameter<std::string>("METType"); 00055 alias = iConfig.getParameter<std::string>("alias"); 00056 globalThreshold = iConfig.getParameter<double>("globalThreshold"); 00057 noHF = iConfig.getParameter<bool>("noHF"); 00058 00059 if( METtype == "CaloMET" ) 00060 produces<CaloMETCollection>().setBranchAlias(alias.c_str()); 00061 else if( METtype == "PFMET" ) 00062 produces<PFMETCollection>().setBranchAlias(alias.c_str()); 00063 else if( METtype == "GenMET" ) 00064 produces<GenMETCollection>().setBranchAlias(alias.c_str()); 00065 else if (METtype == "CaloMETSignif") 00066 produces<CaloMETCollection>().setBranchAlias(alias.c_str()); 00067 else 00068 produces<METCollection>().setBranchAlias(alias.c_str()); 00069 }
METProducer::METProducer | ( | ) | [explicit] |
Definition at line 75 of file METProducer.cc.
00075 : alg_() 00076 { 00077 produces<METCollection>(); 00078 }
METProducer::~METProducer | ( | ) | [virtual] |
void METProducer::produce | ( | edm::Event & | event, | |
const edm::EventSetup & | setup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 90 of file METProducer.cc.
References SignCaloSpecificAlgo::addInfo(), CaloSpecificAlgo::addInfo(), PFSpecificAlgo::addInfo(), GenSpecificAlgo::addInfo(), iggi_31X_cfg::input, HLT_VtxMuL3::inputLabel, CaloMET_cfi::met, CommonMETData::met, CommonMETData::mex, CommonMETData::mey, output(), p4, and CommonMETData::sumet.
00091 { 00092 00093 //----------------------------------- 00094 // Step A: Get Inputs. Create an empty collection of candidates 00095 edm::Handle<edm::View<Candidate> > input; 00096 event.getByLabel(inputLabel,input); 00097 //----------------------------------- 00098 // Step B: Create an empty MET struct output. 00099 CommonMETData output; 00100 /* 00101 //----------------------------------- 00102 // Step C: Convert input source to type CandidateCollection 00103 const RefToBaseVector<Candidate> inputCol = inputHandle->refVector(); 00104 const CandidateCollection *input = (const CandidateCollection *)inputCol.product(); 00105 */ 00106 //----------------------------------- 00107 // Step C2: Invoke the MET algorithm, which runs on any CandidateCollection input. 00108 alg_.run(input, &output, globalThreshold); 00109 //----------------------------------- 00110 // Step D: Invoke the specific "afterburner", which adds information 00111 // depending on the input type, given via the config parameter. 00112 // Also, after the specific algorithm has been called, store 00113 // the output into the Event. 00114 if( METtype == "CaloMET" ) 00115 { 00116 CaloSpecificAlgo calo; 00117 std::auto_ptr<CaloMETCollection> calometcoll; 00118 calometcoll.reset(new CaloMETCollection); 00119 calometcoll->push_back( calo.addInfo(input, output, noHF, globalThreshold) ); 00120 event.put( calometcoll ); 00121 } 00122 //----------------------------------- 00123 else if( METtype == "PFMET" ) 00124 { 00125 PFSpecificAlgo pf; 00126 std::auto_ptr<PFMETCollection> pfmetcoll; 00127 pfmetcoll.reset (new PFMETCollection); 00128 pfmetcoll->push_back( pf.addInfo(input, output) ); 00129 event.put( pfmetcoll ); 00130 } 00131 //----------------------------------- 00132 else if( METtype == "GenMET" ) 00133 { 00134 GenSpecificAlgo gen; 00135 std::auto_ptr<GenMETCollection> genmetcoll; 00136 genmetcoll.reset (new GenMETCollection); 00137 genmetcoll->push_back( gen.addInfo(input, output) ); 00138 event.put( genmetcoll ); 00139 } 00140 //----------------------------------- 00141 else if( METtype == "CaloMETSignif" ) 00142 { 00143 SignCaloSpecificAlgo calo; 00144 // first calculate all standard info. Then over-write the values used by the significance: 00145 std::auto_ptr<CaloMETCollection> calometcoll; 00146 calometcoll.reset(new CaloMETCollection); 00147 metsig::SignAlgoResolutions resolutions(conf_); 00148 calometcoll->push_back( calo.addInfo(input, output, resolutions, noHF, globalThreshold) ); 00149 event.put( calometcoll ); 00150 } 00151 //----------------------------------- 00152 else 00153 { 00154 LorentzVector p4( output.mex, output.mey, 0.0, output.met); 00155 Point vtx(0,0,0); 00156 MET met( output.sumet, p4, vtx ); 00157 std::auto_ptr<METCollection> metcoll; 00158 metcoll.reset(new METCollection); 00159 metcoll->push_back( met ); 00160 event.put( metcoll ); 00161 } 00162 //----------------------------------- 00163 }
METAlgo cms::METProducer::alg_ [private] |
Definition at line 45 of file METProducer.h.
std::string cms::METProducer::alias [private] |
edm::ParameterSet cms::METProducer::conf_ [private] |
Definition at line 52 of file METProducer.h.
double cms::METProducer::globalThreshold [private] |
edm::InputTag cms::METProducer::inputLabel [private] |
std::string cms::METProducer::inputType [private] |
std::string cms::METProducer::METtype [private] |
bool cms::METProducer::noHF [private] |