39 |
|
} |
40 |
|
|
41 |
|
trkupgradeanalysis::IsolationStudyPlotSet::IsolationStudyPlotSet() |
42 |
< |
: histogramHaveBeenBooked_(false), leastIsolatedDiMuon_(true), leastDeltaBetaCorrectedIsolatedDiMuon_(true) |
42 |
> |
: histogramHaveBeenBooked_(false), leastIsolatedDiMuon_(false), leastDeltaBetaCorrectedIsolatedDiMuon_(false) |
43 |
|
{ |
44 |
|
// No operation besides the initialiser list. |
45 |
|
} |
55 |
|
// |
56 |
|
|
57 |
|
|
58 |
– |
// pGlobalChi2_=new TH1F( "globalChi2","Global chi2", 60, 0, 20 ); |
59 |
– |
// pGlobalChi2_->SetDirectory(pDirectory); |
60 |
– |
|
61 |
– |
// pLeastIsolatedDiMuonTree_=new TTree("leastIsolatedDiMuonTree","Data about the least isolated muon in the di-muon pair"); |
62 |
– |
// pLeastIsolatedDiMuonTree_->Branch("numberOfPrimaryVertices",&numberOfPrimaryVertices_branch_,"numberOfPrimaryVertices/I"); |
63 |
– |
// pLeastIsolatedDiMuonTree_->Branch("chargedIsolation",&chargedIsolation_branch_,"chargedIsolation/F"); |
64 |
– |
// pLeastIsolatedDiMuonTree_->Branch("photonIsolation",&photonIsolation_branch_,"photonIsolation/F"); |
65 |
– |
// pLeastIsolatedDiMuonTree_->Branch("neutralIsolation",&neutralIsolation_branch_,"neutralIsolation/F"); |
66 |
– |
// pLeastIsolatedDiMuonTree_->Branch("pileupIsolation",&pileupIsolation_branch_,"pileupIsolation/F"); |
67 |
– |
// pLeastIsolatedDiMuonTree_->Branch("pT",&pT_branch_,"pT/F"); |
68 |
– |
// pLeastIsolatedDiMuonTree_->SetDirectory( pDirectory ); |
69 |
– |
|
58 |
|
TDirectory* pNewDirectory; |
59 |
|
pNewDirectory=pDirectory->mkdir("cleanedMuons"); |
60 |
|
cleanedMuons_.book( pNewDirectory ); |
61 |
|
|
62 |
+ |
pNewDirectory=pDirectory->mkdir("cleanedElectrons"); |
63 |
+ |
cleanedElectrons_.book( pNewDirectory ); |
64 |
+ |
|
65 |
|
pNewDirectory=pDirectory->mkdir("highestPtDiMuon"); |
66 |
|
highestPtDiMuon_.book( pNewDirectory ); |
67 |
|
|
88 |
|
{ |
89 |
|
// Clean the muons with all the criteria of the VHbb package (apart from isolation) |
90 |
|
std::vector<VHbbEvent::MuonInfo> cleanedMuons=cleanMuons( event.muInfo ); |
91 |
+ |
cleanedMuons_.fill( cleanedMuons, pAuxInfo ); // Fill some plots about the cleaned muons |
92 |
+ |
|
93 |
+ |
// Clean the muons with all the criteria of the VHbb package (apart from isolation) |
94 |
+ |
std::vector<VHbbEvent::ElectronInfo> cleanedElectrons=cleanElectrons( event.eleInfo ); |
95 |
+ |
cleanedElectrons_.fill( cleanedElectrons, pAuxInfo ); // Fill some plots about the cleaned muons |
96 |
+ |
|
97 |
|
// Then make sure they're sorted high to low by pT |
98 |
|
std::sort( cleanedMuons.begin(), cleanedMuons.end(), ::SortByTransverseMomentum<VHbbEvent::MuonInfo>() ); |
99 |
|
// Then find two with opposite charge |
103 |
|
if( pAuxInfo ) numberOfPrimaryVertices=pAuxInfo->pvInfo.nVertices; |
104 |
|
else numberOfPrimaryVertices=-1; |
105 |
|
|
109 |
– |
cleanedMuons_.fill( cleanedMuons, pAuxInfo ); // Fill some plots about the cleaned muons |
106 |
|
highestPtDiMuon_.fill( diMuons.first, pAuxInfo ); // I know the collection is already sorted by pT, so the first has the highest. |
107 |
|
lowestPtDiMuon_.fill( diMuons.second, pAuxInfo ); |
108 |
|
|
147 |
|
} |
148 |
|
|
149 |
|
return returnValue; |
150 |
+ |
} |
151 |
+ |
|
152 |
+ |
std::vector<VHbbEvent::ElectronInfo> trkupgradeanalysis::IsolationStudyPlotSet::cleanElectrons( const std::vector<VHbbEvent::ElectronInfo>& electrons ) |
153 |
+ |
{ |
154 |
+ |
std::vector<VHbbEvent::ElectronInfo> returnValue; |
155 |
+ |
|
156 |
+ |
for( std::vector<VHbbEvent::ElectronInfo>::const_iterator iElectron=electrons.begin(); iElectron!=electrons.end(); ++iElectron ) |
157 |
+ |
{ |
158 |
+ |
if( (std::fabs(iElectron->id95-7)<0.1 || std::fabs(iElectron->id95-5)<0.1) && |
159 |
+ |
std::fabs(iElectron->p4.Eta()) < 2.5 && |
160 |
+ |
iElectron->p4.Pt()>20 ) returnValue.push_back(*iElectron); |
161 |
+ |
} |
162 |
+ |
|
163 |
+ |
return returnValue; |
164 |
|
} |
165 |
|
|
166 |
|
std::pair<VHbbEvent::MuonInfo,VHbbEvent::MuonInfo> trkupgradeanalysis::IsolationStudyPlotSet::findOppositelyChargedPair( const std::vector<VHbbEvent::MuonInfo>& muons ) |