15 #include "TLorentzVector.h"
24 theMissingETSource(
"met")
26 LogDebug(
"Alignment") <<
"> applying two body decay Trackfilter ...";
91 LogDebug(
"Alignment") <<
"> TwoBodyDecay tracks all,kept: " << tracks.size() <<
"," << result.size();
100 return a.first > b.first ;
110 LogDebug(
"Alignment") <<
"> cands size : "<< cands.size();
112 if (cands.size()<2)
return result;
114 TLorentzVector track0;
115 TLorentzVector track1;
116 TLorentzVector mother;
117 typedef pair<const reco::Track*,const reco::Track*> constTrackPair;
118 typedef pair<double,constTrackPair> candCollectionItem;
119 vector<candCollectionItem> candCollection;
121 for (
unsigned int iCand = 0; iCand < cands.size(); iCand++) {
123 track0.SetXYZT(cands.at(iCand)->px(),
124 cands.at(iCand)->py(),
125 cands.at(iCand)->pz(),
128 for (
unsigned int jCand = iCand+1; jCand < cands.size(); jCand++) {
130 track1.SetXYZT(cands.at(jCand)->px(),
131 cands.at(jCand)->py(),
132 cands.at(jCand)->pz(),
135 mother = track0 + track1;
140 bool correctCharge =
true;
143 bool acoplanarTracks =
true;
150 candCollection.push_back(candCollectionItem(mother.Pt(),
151 constTrackPair(trk1, trk2)));
156 if (candCollection.size()==0)
return result;
158 sort(candCollection.begin(), candCollection.end(),
161 std::map<const reco::Track*,unsigned int> uniqueTrackIndex;
162 std::map<const reco::Track*,unsigned int>::iterator it;
163 for (
unsigned int i=0;
166 constTrackPair & trackPair = candCollection[
i].second;
168 it = uniqueTrackIndex.find(trackPair.first);
169 if (it==uniqueTrackIndex.end()) {
170 result.push_back(trackPair.first);
171 uniqueTrackIndex[trackPair.first] =
i;
174 it = uniqueTrackIndex.find(trackPair.second);
175 if (it==uniqueTrackIndex.end()) {
176 result.push_back(trackPair.second);
177 uniqueTrackIndex[trackPair.second] =
i;
190 LogDebug(
"Alignment") <<
"> cands size : "<< cands.size();
192 if (cands.size()==0)
return result;
194 TLorentzVector track;
196 TLorentzVector mother;
201 LogError(
"Alignment")<<
"@SUB=AlignmentTwoBodyDecayTrackSelector::checkMETMass"
202 <<
"> could not optain missingET Collection!";
206 typedef pair<double,const reco::Track*> candCollectionItem;
207 vector<candCollectionItem> candCollection;
209 for (reco::CaloMETCollection::const_iterator itMET = missingET->begin();
210 itMET != missingET->end();
213 met4.SetXYZT((*itMET).px(),
218 for (
unsigned int iCand = 0; iCand < cands.size(); iCand++) {
220 track.SetXYZT(cands.at(iCand)->px(),
221 cands.at(iCand)->py(),
222 cands.at(iCand)->pz(),
225 mother = track + met4;
230 bool correctCharge =
true;
233 bool acoplanarTracks =
true;
240 candCollection.push_back(candCollectionItem(mother.Pt(), trk));
245 if (candCollection.size()==0)
return result;
247 sort(candCollection.begin(), candCollection.end(),
250 std::map<const reco::Track*,unsigned int> uniqueTrackIndex;
251 std::map<const reco::Track*,unsigned int>::iterator it;
252 for (
unsigned int i=0;
255 it = uniqueTrackIndex.find(candCollection[
i].
second);
256 if (it==uniqueTrackIndex.end()) {
257 result.push_back(candCollection[
i].second);
258 uniqueTrackIndex[candCollection[
i].second] =
i;
269 int sumCharge = trk1->
charge();
270 if (trk2) sumCharge += trk2->
charge();
298 LogDebug(
"Alignment") <<
">......................................";
299 for(Tracks::const_iterator it = col.begin();it < col.end();++it,++
count){
301 <<
"> Track No. "<< count <<
": p = ("<<(*it)->px()<<
","<<(*it)->py()<<
","<<(*it)->pz()<<
")\n"
302 <<
"> pT = "<<(*it)->pt()<<
" eta = "<<(*it)->eta()<<
" charge = "<<(*it)->charge();
304 LogDebug(
"Alignment") <<
">......................................";
std::vector< const reco::Track * > Tracks
T getParameter(std::string const &) const
Tracks select(const Tracks &tracks, const edm::Event &iEvent)
select tracks
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
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
virtual double phi() const
momentum azimuthal angle
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