CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
AlignmentTwoBodyDecayTrackSelector Class Reference

#include <AlignmentTwoBodyDecayTrackSelector.h>

Public Types

typedef std::vector< const
reco::Track * > 
Tracks
 

Public Member Functions

 AlignmentTwoBodyDecayTrackSelector (const edm::ParameterSet &cfg)
 constructor More...
 
Tracks select (const Tracks &tracks, const edm::Event &iEvent)
 select tracks More...
 
bool useThisFilter ()
 returns if any of the Filters is used. More...
 
 ~AlignmentTwoBodyDecayTrackSelector ()
 destructor More...
 

Private Member Functions

Tracks checkAcoplanarity (const Tracks &cands) const
 checks if the [cands] are acoplanar (returns empty set if not) More...
 
Tracks checkCharge (const Tracks &cands) const
 checks if the mother has charge = [theCharge] More...
 
Tracks checkMass (const Tracks &cands) const
 checks if the mass of the mother is in the mass region More...
 
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) More...
 
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 More...
 
void printTracks (const Tracks &col) const
 print Information on Track-Collection More...
 

Private Attributes

double theAcoplanarDistance
 
bool theAcoplanarityFilterSwitch
 
int theCharge
 
bool theChargeSwitch
 
double theDaughterMass
 
bool theMassrangeSwitch
 private data members More...
 
double theMaxMass
 
double theMinMass
 
edm::InputTag theMissingETSource
 
bool theMissingETSwitch
 
bool theUnsignedSwitch
 

Detailed Description

Definition at line 14 of file AlignmentTwoBodyDecayTrackSelector.h.

Member Typedef Documentation

Definition at line 18 of file AlignmentTwoBodyDecayTrackSelector.h.

Constructor & Destructor Documentation

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.

24  :
25  theMissingETSource("met")
26 {
27  LogDebug("Alignment") << "> applying two body decay Trackfilter ...";
28  theMassrangeSwitch = cfg.getParameter<bool>( "applyMassrangeFilter" );
29  if (theMassrangeSwitch){
30  theMinMass = cfg.getParameter<double>( "minXMass" );
31  theMaxMass = cfg.getParameter<double>( "maxXMass" );
32  theDaughterMass = cfg.getParameter<double>( "daughterMass" );
33  LogDebug("Alignment") << "> Massrange min,max : " << theMinMass << "," << theMaxMass
34  << "\n> Mass of daughter Particle : " << theDaughterMass;
35 
36  }else{
37  theMinMass = 0;
38  theMaxMass = 0;
39  theDaughterMass = 0;
40  }
41  theChargeSwitch = cfg.getParameter<bool>( "applyChargeFilter" );
42  if(theChargeSwitch){
43  theCharge = cfg.getParameter<int>( "charge" );
44  theUnsignedSwitch = cfg.getParameter<bool>( "useUnsignedCharge" );
45  if(theUnsignedSwitch)
47  LogDebug("Alignment") << "> Desired Charge, unsigned: "<<theCharge<<" , "<<theUnsignedSwitch;
48  }else{
49  theCharge =0;
50  theUnsignedSwitch = true;
51  }
52  theMissingETSwitch = cfg.getParameter<bool>( "applyMissingETFilter" );
54  theMissingETSource = cfg.getParameter<InputTag>( "missingETSource" );
55  LogDebug("Alignment") << "> missing Et Source: "<< theMissingETSource;
56  }
57  theAcoplanarityFilterSwitch = cfg.getParameter<bool>( "applyAcoplanarityFilter" );
59  theAcoplanarDistance = cfg.getParameter<double>( "acoplanarDistance" );
60  LogDebug("Alignment") << "> Acoplanar Distance: "<<theAcoplanarDistance;
61  }
62 
63 }
#define LogDebug(id)
T getParameter(std::string const &) const
#define abs(x)
Definition: mlp_lapack.h:159
AlignmentTwoBodyDecayTrackSelector::~AlignmentTwoBodyDecayTrackSelector ( )

destructor

Definition at line 67 of file AlignmentTwoBoyDecayTrackSelector.cc.

68 {}

Member Function Documentation

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

172 {
173  Tracks result; result.clear();
174  //TODO return the biggest set of acoplanar tracks or two tracks with smallest distance?
175  if(cands.size() == 2){
176  LogDebug("Alignment") <<"> Acoplanarity: "<<fabs(fabs(deltaPhi(cands.at(0)->phi(),cands.at(1)->phi()))-M_PI)<<endl;
177  if(fabs(fabs(deltaPhi(cands.at(0)->phi(),cands.at(1)->phi()))-M_PI)<theAcoplanarDistance)
178  result = cands;
179  }
180  return result;
181 }
#define LogDebug(id)
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
tuple result
Definition: query.py:137
#define M_PI
Definition: BFit3D.cc:3
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().

156 {
157  Tracks result; result.clear();
158  int sumCharge = 0;
159  for(Tracks::const_iterator it = cands.begin();it < cands.end();++it)
160  sumCharge += (*it)->charge();
162  sumCharge = std::abs(sumCharge);
163  if(sumCharge == theCharge)
164  result = cands;
165 
166  return result;
167 }
#define abs(x)
Definition: mlp_lapack.h:159
tuple result
Definition: query.py:137
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().

108 {
109  Tracks result; result.clear();
110  //TODO perhaps try combinations if there are more than 2 tracks ....
111  if(cands.size() == 2){
112  //TODO use other vectors here
113  TLorentzVector track0(cands.at(0)->px(),cands.at(0)->py(),cands.at(0)->pz(),
114  sqrt((cands.at(0)->p()*cands.at(0)->p())+theDaughterMass*theDaughterMass));
115  TLorentzVector track1(cands.at(1)->px(),cands.at(1)->py(),cands.at(1)->pz(),
116  sqrt((cands.at(1)->p()*cands.at(1)->p())+theDaughterMass*theDaughterMass));
117  TLorentzVector mother = track0+track1;
118  if(mother.M() > theMinMass && mother.M() < theMaxMass)
119  result = cands;
120  LogDebug("Alignment") <<"> mass of mother: "<<mother.M()<<"GeV";
121  }
122  return result;
123 }
#define LogDebug(id)
T sqrt(T t)
Definition: SSEVec.h:28
tuple result
Definition: query.py:137
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().

185 {
186  Tracks result; result.clear();
187  if(cands.size() == 1){
189  iEvent.getByLabel(theMissingETSource ,missingET);
190  if(missingET.isValid()){
191  //TODO return the biggest set of acoplanar tracks or the one with smallest distance?
192  LogDebug("Alignment") <<"> METAcoplanarity: "<<fabs(fabs(deltaPhi(cands.at(0)->phi(),(*missingET).at(0).phi()))-M_PI)<<endl;
193  if(fabs(fabs(deltaPhi(cands.at(0)->phi(),(*missingET).at(0).phi()))-M_PI)<theAcoplanarDistance)
194  result = cands;
195 
196  }else
197  LogError("Alignment")<<"@SUB=AlignmentTwoBodyDecayTrackSelector::checkMETAcoplanarity"
198  <<"> could not optain missingET Collection!";
199  }
200  return result;
201 }
#define LogDebug(id)
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
#define M_PI
Definition: BFit3D.cc:3
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().

128 {
129  Tracks result; result.clear();
130  if(cands.size() == 1){
132  iEvent.getByLabel(theMissingETSource ,missingET);
133  if(missingET.isValid()){
134  //TODO use the one with highest pt instead of the first one?
135  // for(reco::CaloMETCollection::const_iterator itMET = missingET->begin(); itMET != missingET->end() ; ++itMET){
136  // cout <<"missingET p = ("<<(*itMET).px()<<","<<(*itMET).py()<<","<<(*itMET).pz()<<")"<<endl;
137  //}
138  TLorentzVector track(cands.at(0)->px(),cands.at(0)->py(),cands.at(0)->pz(),
139  sqrt((cands.at(0)->p()*cands.at(0)->p())+theDaughterMass*theDaughterMass));
140  TLorentzVector met((*missingET).at(0).px(),(*missingET).at(0).py(),(*missingET).at(0).pz(),
141  (*missingET).at(0).p());//ignoring nuetralino masses for now ;)
142  TLorentzVector motherSystem = track + met;
143  if(motherSystem.M() > theMinMass && motherSystem.M() < theMaxMass)
144  result = cands;
145  LogDebug("Alignment") <<"> mass of motherSystem: "<<motherSystem.M()<<"GeV";
146  }else
147  LogError("Alignment")<<"@SUB=AlignmentTwoBodyDecayTrackSelector::checkMETMass"
148  <<"> could not optain missingET Collection!";
149  }
150  return cands;
151 }
#define LogDebug(id)
T sqrt(T t)
Definition: SSEVec.h:28
tuple result
Definition: query.py:137
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
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.

207 {
208  int count = 0;
209  LogDebug("Alignment") << ">......................................";
210  for(Tracks::const_iterator it = col.begin();it < col.end();++it,++count){
211  LogDebug("Alignment")
212  <<"> Track No. "<< count <<": p = ("<<(*it)->px()<<","<<(*it)->py()<<","<<(*it)->pz()<<")\n"
213  <<"> pT = "<<(*it)->pt()<<" eta = "<<(*it)->eta()<<" charge = "<<(*it)->charge();
214  }
215  LogDebug("Alignment") << ">......................................";
216 }
#define LogDebug(id)
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 python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), python.Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), python.Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), python.Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), python.Vispa.Views.AbstractView.AbstractView::restoreSelection(), and TrackConfigSelector::select().

81 {
83 
84  if(theMassrangeSwitch){
86  result = checkMETMass(result,iEvent);
87  else
88  result = checkMass(result);
89  }
90  if(theChargeSwitch)
91  result = checkCharge(result);
94  result = checkMETAcoplanarity(result,iEvent);
95  else
96  result = checkAcoplanarity(result);
97  }
98  LogDebug("Alignment") << "> TwoBodyDecay tracks all,kept: " << tracks.size() << "," << result.size();
99  // LogDebug("AlignmentTwoBodyDecayTrackSelector")<<"> o kept:";
100  //printTracks(result);
101  return result;
102 
103 }
#define LogDebug(id)
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) ...
tuple result
Definition: query.py:137
Tracks checkAcoplanarity(const Tracks &cands) const
checks if the [cands] are acoplanar (returns empty set if not)
tuple tracks
Definition: testEve_cfg.py:39
Tracks checkCharge(const Tracks &cands) const
checks if the mother has charge = [theCharge]
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
Tracks checkMass(const Tracks &cands) const
checks if the mass of the mother is in the mass region
bool AlignmentTwoBodyDecayTrackSelector::useThisFilter ( )

Member Data Documentation

double AlignmentTwoBodyDecayTrackSelector::theAcoplanarDistance
private
bool AlignmentTwoBodyDecayTrackSelector::theAcoplanarityFilterSwitch
private
int AlignmentTwoBodyDecayTrackSelector::theCharge
private
bool AlignmentTwoBodyDecayTrackSelector::theChargeSwitch
private
double AlignmentTwoBodyDecayTrackSelector::theDaughterMass
private
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
double AlignmentTwoBodyDecayTrackSelector::theMinMass
private
edm::InputTag AlignmentTwoBodyDecayTrackSelector::theMissingETSource
private
bool AlignmentTwoBodyDecayTrackSelector::theMissingETSwitch
private
bool AlignmentTwoBodyDecayTrackSelector::theUnsignedSwitch
private