15 #include "TLorentzVector.h"
24 theMissingETSource(
"met")
26 LogDebug(
"Alignment") <<
"> applying two body decay Trackfilter ...";
93 LogDebug(
"Alignment") <<
"> TwoBodyDecay tracks all,kept: " << tracks.size() <<
"," << result.size();
102 return a.first > b.first ;
112 LogDebug(
"Alignment") <<
"> cands size : "<< cands.size();
114 if (cands.size()<2)
return result;
116 TLorentzVector track0;
117 TLorentzVector track1;
118 TLorentzVector mother;
119 typedef pair<const reco::Track*,const reco::Track*> constTrackPair;
120 typedef pair<double,constTrackPair> candCollectionItem;
121 vector<candCollectionItem> candCollection;
123 for (
unsigned int iCand = 0; iCand < cands.size(); iCand++) {
125 track0.SetXYZT(cands.at(iCand)->px(),
126 cands.at(iCand)->py(),
127 cands.at(iCand)->pz(),
130 for (
unsigned int jCand = iCand+1; jCand < cands.size(); jCand++) {
132 track1.SetXYZT(cands.at(jCand)->px(),
133 cands.at(jCand)->py(),
134 cands.at(jCand)->pz(),
137 mother = track0 + track1;
142 bool correctCharge =
true;
145 bool acoplanarTracks =
true;
152 candCollection.push_back(candCollectionItem(mother.Pt(),
153 constTrackPair(trk1, trk2)));
158 if (candCollection.size()==0)
return result;
160 sort(candCollection.begin(), candCollection.end(),
163 std::map<const reco::Track*,unsigned int> uniqueTrackIndex;
164 std::map<const reco::Track*,unsigned int>::iterator it;
165 for (
unsigned int i=0;
168 constTrackPair & trackPair = candCollection[
i].second;
170 it = uniqueTrackIndex.find(trackPair.first);
171 if (it==uniqueTrackIndex.end()) {
172 result.push_back(trackPair.first);
173 uniqueTrackIndex[trackPair.first] =
i;
176 it = uniqueTrackIndex.find(trackPair.second);
177 if (it==uniqueTrackIndex.end()) {
178 result.push_back(trackPair.second);
179 uniqueTrackIndex[trackPair.second] =
i;
192 LogDebug(
"Alignment") <<
"> cands size : "<< cands.size();
194 if (cands.size()==0)
return result;
196 TLorentzVector track;
198 TLorentzVector mother;
203 LogError(
"Alignment")<<
"@SUB=AlignmentTwoBodyDecayTrackSelector::checkMETMass"
204 <<
"> could not optain missingET Collection!";
208 typedef pair<double,const reco::Track*> candCollectionItem;
209 vector<candCollectionItem> candCollection;
211 for (reco::CaloMETCollection::const_iterator itMET = missingET->begin();
212 itMET != missingET->end();
215 met4.SetXYZT((*itMET).px(),
220 for (
unsigned int iCand = 0; iCand < cands.size(); iCand++) {
222 track.SetXYZT(cands.at(iCand)->px(),
223 cands.at(iCand)->py(),
224 cands.at(iCand)->pz(),
227 mother = track + met4;
232 bool correctCharge =
true;
235 bool acoplanarTracks =
true;
242 candCollection.push_back(candCollectionItem(mother.Pt(), trk));
247 if (candCollection.size()==0)
return result;
249 sort(candCollection.begin(), candCollection.end(),
252 std::map<const reco::Track*,unsigned int> uniqueTrackIndex;
253 std::map<const reco::Track*,unsigned int>::iterator it;
254 for (
unsigned int i=0;
257 it = uniqueTrackIndex.find(candCollection[
i].
second);
258 if (it==uniqueTrackIndex.end()) {
259 result.push_back(candCollection[
i].second);
260 uniqueTrackIndex[candCollection[
i].second] =
i;
271 int sumCharge = trk1->
charge();
272 if (trk2) sumCharge += trk2->
charge();
300 LogDebug(
"Alignment") <<
">......................................";
301 for(Tracks::const_iterator it = col.begin();it < col.end();++it,++
count){
303 <<
"> Track No. "<< count <<
": p = ("<<(*it)->px()<<
","<<(*it)->py()<<
","<<(*it)->pz()<<
")\n"
304 <<
"> pT = "<<(*it)->pt()<<
" eta = "<<(*it)->eta()<<
" charge = "<<(*it)->charge();
306 LogDebug(
"Alignment") <<
">......................................";
std::vector< const reco::Track * > Tracks
T getParameter(std::string const &) const
tuple met
____________________________________________________________________________||
virtual float phi() const
momentum azimuthal angle
double phi() const
azimuthal angle of momentum vector
bool checkMETAcoplanarity(const reco::Track *trk, const reco::CaloMET *met) const
checks if [cands] contains a acoplanar track w.r.t missing ET (returns empty set if not) ...
bool checkAcoplanarity(const reco::Track *trk1, const reco::Track *trk2) const
checks if the [cands] are acoplanar (returns empty set if not)
U second(std::pair< T, U > const &p)
~AlignmentTwoBodyDecayTrackSelector()
destructor
double theAcoplanarDistance
unsigned int theCandNumber
bool checkCharge(const reco::Track *trk1, const reco::Track *trk2=0) const
checks if the mother has charge = [theCharge]
bool useThisFilter()
returns if any of the Filters is used.
void printTracks(const Tracks &col) const
print Information on Track-Collection
Abs< T >::type abs(const T &t)
Tracks select(const Tracks &tracks, const edm::Event &iEvent, const edm::EventSetup &iSetup)
select tracks
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
bool operator()(const T &a, const T &b)
AlignmentTwoBodyDecayTrackSelector(const edm::ParameterSet &cfg)
constructor
bool theMassrangeSwitch
private data members
int charge() const
track electric charge
edm::InputTag theMissingETSource
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 theAcoplanarityFilterSwitch