#include <AlignmentTwoBodyDecayTrackSelector.h>
Public Types | |
typedef std::vector< const reco::Track * > | Tracks |
Public Member Functions | |
AlignmentTwoBodyDecayTrackSelector (const edm::ParameterSet &cfg) | |
constructor | |
Tracks | select (const Tracks &tracks, const edm::Event &iEvent) |
select tracks | |
bool | useThisFilter () |
returns if any of the Filters is used. | |
~AlignmentTwoBodyDecayTrackSelector () | |
destructor | |
Private Member Functions | |
Tracks | checkAcoplanarity (const Tracks &cands) const |
checks if the [cands] are acoplanar (returns empty set if not) | |
Tracks | checkCharge (const Tracks &cands) const |
checks if the mother has charge = [theCharge] | |
Tracks | checkMass (const Tracks &cands) const |
checks if the mass of the mother is in the mass region | |
Tracks | checkMETAcoplanarity (const Tracks &cands, const edm::Event &iEvent) const |
checks if [cands] contains a acoplanar track w.r.t missing ET (returns empty set if not) | |
Tracks | checkMETMass (const Tracks &cands, const edm::Event &iEvent) const |
checks if the mass of the mother is in the mass region adding missing E_T | |
void | printTracks (const Tracks &col) const |
print Information on Track-Collection | |
Private Attributes | |
double | theAcoplanarDistance |
bool | theAcoplanarityFilterSwitch |
int | theCharge |
bool | theChargeSwitch |
double | theDaughterMass |
bool | theMassrangeSwitch |
private data members | |
double | theMaxMass |
double | theMinMass |
edm::InputTag | theMissingETSource |
bool | theMissingETSwitch |
bool | theUnsignedSwitch |
Definition at line 14 of file AlignmentTwoBodyDecayTrackSelector.h.
typedef std::vector<const reco::Track*> AlignmentTwoBodyDecayTrackSelector::Tracks |
Definition at line 18 of file AlignmentTwoBodyDecayTrackSelector.h.
AlignmentTwoBodyDecayTrackSelector::AlignmentTwoBodyDecayTrackSelector | ( | const edm::ParameterSet & | cfg | ) |
constructor
Definition at line 24 of file AlignmentTwoBoyDecayTrackSelector.cc.
References abs, edm::ParameterSet::getParameter(), LogDebug, theAcoplanarDistance, theAcoplanarityFilterSwitch, theCharge, theChargeSwitch, theDaughterMass, theMassrangeSwitch, theMaxMass, theMinMass, theMissingETSource, theMissingETSwitch, and theUnsignedSwitch.
: theMissingETSource("met") { LogDebug("Alignment") << "> applying two body decay Trackfilter ..."; theMassrangeSwitch = cfg.getParameter<bool>( "applyMassrangeFilter" ); if (theMassrangeSwitch){ theMinMass = cfg.getParameter<double>( "minXMass" ); theMaxMass = cfg.getParameter<double>( "maxXMass" ); theDaughterMass = cfg.getParameter<double>( "daughterMass" ); LogDebug("Alignment") << "> Massrange min,max : " << theMinMass << "," << theMaxMass << "\n> Mass of daughter Particle : " << theDaughterMass; }else{ theMinMass = 0; theMaxMass = 0; theDaughterMass = 0; } theChargeSwitch = cfg.getParameter<bool>( "applyChargeFilter" ); if(theChargeSwitch){ theCharge = cfg.getParameter<int>( "charge" ); theUnsignedSwitch = cfg.getParameter<bool>( "useUnsignedCharge" ); if(theUnsignedSwitch) theCharge=std::abs(theCharge); LogDebug("Alignment") << "> Desired Charge, unsigned: "<<theCharge<<" , "<<theUnsignedSwitch; }else{ theCharge =0; theUnsignedSwitch = true; } theMissingETSwitch = cfg.getParameter<bool>( "applyMissingETFilter" ); if(theMissingETSwitch){ theMissingETSource = cfg.getParameter<InputTag>( "missingETSource" ); LogDebug("Alignment") << "> missing Et Source: "<< theMissingETSource; } theAcoplanarityFilterSwitch = cfg.getParameter<bool>( "applyAcoplanarityFilter" ); if(theAcoplanarityFilterSwitch){ theAcoplanarDistance = cfg.getParameter<double>( "acoplanarDistance" ); LogDebug("Alignment") << "> Acoplanar Distance: "<<theAcoplanarDistance; } }
AlignmentTwoBodyDecayTrackSelector::~AlignmentTwoBodyDecayTrackSelector | ( | ) |
AlignmentTwoBodyDecayTrackSelector::Tracks AlignmentTwoBodyDecayTrackSelector::checkAcoplanarity | ( | const Tracks & | cands | ) | const [private] |
checks if the [cands] are acoplanar (returns empty set if not)
Definition at line 171 of file AlignmentTwoBoyDecayTrackSelector.cc.
References Geom::deltaPhi(), LogDebug, M_PI, query::result, and theAcoplanarDistance.
Referenced by select().
{ Tracks result; result.clear(); //TODO return the biggest set of acoplanar tracks or two tracks with smallest distance? if(cands.size() == 2){ LogDebug("Alignment") <<"> Acoplanarity: "<<fabs(fabs(deltaPhi(cands.at(0)->phi(),cands.at(1)->phi()))-M_PI)<<endl; if(fabs(fabs(deltaPhi(cands.at(0)->phi(),cands.at(1)->phi()))-M_PI)<theAcoplanarDistance) result = cands; } return result; }
AlignmentTwoBodyDecayTrackSelector::Tracks AlignmentTwoBodyDecayTrackSelector::checkCharge | ( | const Tracks & | cands | ) | const [private] |
checks if the mother has charge = [theCharge]
Definition at line 155 of file AlignmentTwoBoyDecayTrackSelector.cc.
References abs, query::result, theCharge, and theUnsignedSwitch.
Referenced by select().
AlignmentTwoBodyDecayTrackSelector::Tracks AlignmentTwoBodyDecayTrackSelector::checkMass | ( | const Tracks & | cands | ) | const [private] |
checks if the mass of the mother is in the mass region
checks if the mass of the X is in the mass region
Definition at line 107 of file AlignmentTwoBoyDecayTrackSelector.cc.
References LogDebug, query::result, mathSSE::sqrt(), theDaughterMass, theMaxMass, and theMinMass.
Referenced by select().
{ Tracks result; result.clear(); //TODO perhaps try combinations if there are more than 2 tracks .... if(cands.size() == 2){ //TODO use other vectors here TLorentzVector track0(cands.at(0)->px(),cands.at(0)->py(),cands.at(0)->pz(), sqrt((cands.at(0)->p()*cands.at(0)->p())+theDaughterMass*theDaughterMass)); TLorentzVector track1(cands.at(1)->px(),cands.at(1)->py(),cands.at(1)->pz(), sqrt((cands.at(1)->p()*cands.at(1)->p())+theDaughterMass*theDaughterMass)); TLorentzVector mother = track0+track1; if(mother.M() > theMinMass && mother.M() < theMaxMass) result = cands; LogDebug("Alignment") <<"> mass of mother: "<<mother.M()<<"GeV"; } return result; }
AlignmentTwoBodyDecayTrackSelector::Tracks AlignmentTwoBodyDecayTrackSelector::checkMETAcoplanarity | ( | const Tracks & | cands, |
const edm::Event & | iEvent | ||
) | const [private] |
checks if [cands] contains a acoplanar track w.r.t missing ET (returns empty set if not)
Definition at line 184 of file AlignmentTwoBoyDecayTrackSelector.cc.
References Geom::deltaPhi(), edm::Event::getByLabel(), edm::HandleBase::isValid(), LogDebug, M_PI, query::result, theAcoplanarDistance, and theMissingETSource.
Referenced by select().
{ Tracks result; result.clear(); if(cands.size() == 1){ Handle<reco::CaloMETCollection> missingET; iEvent.getByLabel(theMissingETSource ,missingET); if(missingET.isValid()){ //TODO return the biggest set of acoplanar tracks or the one with smallest distance? LogDebug("Alignment") <<"> METAcoplanarity: "<<fabs(fabs(deltaPhi(cands.at(0)->phi(),(*missingET).at(0).phi()))-M_PI)<<endl; if(fabs(fabs(deltaPhi(cands.at(0)->phi(),(*missingET).at(0).phi()))-M_PI)<theAcoplanarDistance) result = cands; }else LogError("Alignment")<<"@SUB=AlignmentTwoBodyDecayTrackSelector::checkMETAcoplanarity" <<"> could not optain missingET Collection!"; } return result; }
AlignmentTwoBodyDecayTrackSelector::Tracks AlignmentTwoBodyDecayTrackSelector::checkMETMass | ( | const Tracks & | cands, |
const edm::Event & | iEvent | ||
) | const [private] |
checks if the mass of the mother is in the mass region adding missing E_T
checks if the mass of the X is in the mass region adding missing E_T
Definition at line 127 of file AlignmentTwoBoyDecayTrackSelector.cc.
References edm::Event::getByLabel(), edm::HandleBase::isValid(), LogDebug, CaloMET_cfi::met, query::result, mathSSE::sqrt(), theDaughterMass, theMaxMass, theMinMass, and theMissingETSource.
Referenced by select().
{ Tracks result; result.clear(); if(cands.size() == 1){ Handle<reco::CaloMETCollection> missingET; iEvent.getByLabel(theMissingETSource ,missingET); if(missingET.isValid()){ //TODO use the one with highest pt instead of the first one? // for(reco::CaloMETCollection::const_iterator itMET = missingET->begin(); itMET != missingET->end() ; ++itMET){ // cout <<"missingET p = ("<<(*itMET).px()<<","<<(*itMET).py()<<","<<(*itMET).pz()<<")"<<endl; //} TLorentzVector track(cands.at(0)->px(),cands.at(0)->py(),cands.at(0)->pz(), sqrt((cands.at(0)->p()*cands.at(0)->p())+theDaughterMass*theDaughterMass)); TLorentzVector met((*missingET).at(0).px(),(*missingET).at(0).py(),(*missingET).at(0).pz(), (*missingET).at(0).p());//ignoring nuetralino masses for now ;) TLorentzVector motherSystem = track + met; if(motherSystem.M() > theMinMass && motherSystem.M() < theMaxMass) result = cands; LogDebug("Alignment") <<"> mass of motherSystem: "<<motherSystem.M()<<"GeV"; }else LogError("Alignment")<<"@SUB=AlignmentTwoBodyDecayTrackSelector::checkMETMass" <<"> could not optain missingET Collection!"; } return cands; }
void AlignmentTwoBodyDecayTrackSelector::printTracks | ( | const Tracks & | col | ) | const [private] |
print Information on Track-Collection
Definition at line 206 of file AlignmentTwoBoyDecayTrackSelector.cc.
References prof2calltree::count, and LogDebug.
{ int count = 0; LogDebug("Alignment") << ">......................................"; for(Tracks::const_iterator it = col.begin();it < col.end();++it,++count){ LogDebug("Alignment") <<"> Track No. "<< count <<": p = ("<<(*it)->px()<<","<<(*it)->py()<<","<<(*it)->pz()<<")\n" <<"> pT = "<<(*it)->pt()<<" eta = "<<(*it)->eta()<<" charge = "<<(*it)->charge(); } LogDebug("Alignment") << ">......................................"; }
AlignmentTwoBodyDecayTrackSelector::Tracks AlignmentTwoBodyDecayTrackSelector::select | ( | const Tracks & | tracks, |
const edm::Event & | iEvent | ||
) |
select tracks
Definition at line 80 of file AlignmentTwoBoyDecayTrackSelector.cc.
References checkAcoplanarity(), checkCharge(), checkMass(), checkMETAcoplanarity(), checkMETMass(), LogDebug, query::result, theAcoplanarityFilterSwitch, theChargeSwitch, theMassrangeSwitch, theMissingETSwitch, and testEve_cfg::tracks.
Referenced by TrackConfigSelector::select().
{ Tracks result=tracks; if(theMassrangeSwitch){ if(theMissingETSwitch) result = checkMETMass(result,iEvent); else result = checkMass(result); } if(theChargeSwitch) result = checkCharge(result); if(theAcoplanarityFilterSwitch){ if(theMissingETSwitch) result = checkMETAcoplanarity(result,iEvent); else result = checkAcoplanarity(result); } LogDebug("Alignment") << "> TwoBodyDecay tracks all,kept: " << tracks.size() << "," << result.size(); // LogDebug("AlignmentTwoBodyDecayTrackSelector")<<"> o kept:"; //printTracks(result); return result; }
bool AlignmentTwoBodyDecayTrackSelector::useThisFilter | ( | ) |
returns if any of the Filters is used.
Definition at line 72 of file AlignmentTwoBoyDecayTrackSelector.cc.
References theAcoplanarityFilterSwitch, theChargeSwitch, and theMassrangeSwitch.
Referenced by TrackConfigSelector::TrackConfigSelector().
{ return theMassrangeSwitch || theChargeSwitch || theAcoplanarityFilterSwitch; }
double AlignmentTwoBodyDecayTrackSelector::theAcoplanarDistance [private] |
Definition at line 58 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), checkAcoplanarity(), and checkMETAcoplanarity().
Definition at line 47 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), select(), and useThisFilter().
int AlignmentTwoBodyDecayTrackSelector::theCharge [private] |
Definition at line 53 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), and checkCharge().
bool AlignmentTwoBodyDecayTrackSelector::theChargeSwitch [private] |
Definition at line 45 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), select(), and useThisFilter().
double AlignmentTwoBodyDecayTrackSelector::theDaughterMass [private] |
Definition at line 51 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), checkMass(), and checkMETMass().
bool AlignmentTwoBodyDecayTrackSelector::theMassrangeSwitch [private] |
private data members
Definition at line 44 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), select(), and useThisFilter().
double AlignmentTwoBodyDecayTrackSelector::theMaxMass [private] |
Definition at line 50 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), checkMass(), and checkMETMass().
double AlignmentTwoBodyDecayTrackSelector::theMinMass [private] |
Definition at line 49 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), checkMass(), and checkMETMass().
Definition at line 56 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), checkMETAcoplanarity(), and checkMETMass().
bool AlignmentTwoBodyDecayTrackSelector::theMissingETSwitch [private] |
Definition at line 46 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), and select().
bool AlignmentTwoBodyDecayTrackSelector::theUnsignedSwitch [private] |
Definition at line 54 of file AlignmentTwoBodyDecayTrackSelector.h.
Referenced by AlignmentTwoBodyDecayTrackSelector(), and checkCharge().