|
ATLAS Offline Software
|
Go to the documentation of this file.
25 #include "CLHEP/Random/RandFlat.h"
44 m_muonSelectionTool(
"CP::MuonSelectionTool/MuonSelectionTool"),
46 m_doQualSelection ( false ),
47 m_doIsoSelection ( false ),
48 m_doPtSelection ( true ),
49 m_doIPSelection ( true ),
50 m_doMCPSelection ( true )
117 ( *m_msgStream) << MSG::INFO <<
" * MuonSelector::Init * m_muonSelectionTool.initialize() success :)" <<
endmsg;
118 if(
m_doDebug){ std::cout <<
" * MuonSelector::Init * m_muonSelectionTool.initialize() success :)" << std::endl;}
121 (*m_msgStream) << MSG::ERROR <<
" * MuonSelector::Init * FAILURE * Muon selction tool retrieving failed :( " <<
endmsg;
138 if(
m_doDebug){ std::cout <<
" * MuonSelector::passSelection * START * new muon " << pxMuon <<
" with pt: " << pxMuon->
pt() << std::endl; }
140 std::vector<bool> passes;
150 passes.push_back(pass);
151 if (
m_doDebug && !pass) std::cout <<
" * MuonSelector::passSelection * Muon Fails QualSelection"<<std::endl;
157 passes.push_back(pass);
158 if (
m_doDebug && !pass) std::cout<<
" * MuonSelector::passSelection * Muon Fails Iso Selection"<<std::endl;
165 passes.push_back(pass);
166 if (
m_doDebug && !pass) std::cout<<
" * MuonSelector::passSelection * Muon Fails pT Selection"<<std::endl;
172 passes.push_back(pass);
173 if (
m_doDebug && !pass) std::cout<<
" * MuonSelector::passSelection * Muon Fails IP Selection"<<std::endl;
179 if (
m_doDebug) std::cout <<
" * MuonSelector::passSelection * muon quality from muonsSelectionTool: " << my_quality << std::endl;
187 passes.push_back(pass);
188 if (
m_doDebug && pass) std::cout<<
" * MuonSelector::passSelection * Muon Passes official m_muonSelectionTool (medium) Selection :)" << std::endl;
189 if (
m_doDebug && !pass) std::cout<<
" * MuonSelector::passSelection * Muon Fails official m_muonSelectionTool (medium) Selection" << std::endl;
194 for (
int i=0;
i <
int(passes.size());
i++)
196 if(
m_doDebug) std::cout <<
" * MuonSelector::passSelection * BAD MUON * muon haven't passed the " <<
i+1 <<
"th selection " << std::endl;
203 if(
m_doDebug){ std::cout <<
" * MuonSelector::passSelection * completed. GOOD MUON " << std::endl; }
221 bool goodTrack =
false;
244 if(
m_doDebug) std::cout <<
" * MuonSelector * passQualCuts() * eBLhits: " << eBLhits
245 <<
" nBLhits: " << nBLhits
246 <<
" nhitsPIX: " << nhitsPIX
247 <<
" nPIXLayers: " << nContribPixLayers
248 <<
" nhitsSCT: " << nhitsSCT
249 <<
" Silicon holes: " << nPIXH + nSCTH
250 <<
" nhitsTRT: " << nhitsTRT
251 <<
" nTRTholes: " << nTRTH
254 if (((!eBLhits) || (nBLhits > 0))
255 && (nhitsPIX + nPIXDS > 1 )
256 && (nhitsSCT + nSCTDS >=6 )
257 && (nPIXH + nSCTH < 2 ) ) {
264 std::cout <<
" * MuonSelector * passQualCuts() * this muon satisfies the hits number QualCuts " << std::endl;
267 std::cout <<
" * MuonSelector * passQualCuts() * this muon did not pass the hits number QualCuts " << std::endl;
277 if(
m_doDebug) std::cout <<
" * MuonSelector::passPtCuts * START *" << std::endl;
283 double pt = 0, ptID, ptMS,ptCB;
285 if ( !(pxMuonID || pxMuonMS || pxMuonCB)){
286 if(
m_doDebug) std::cout <<
" * MuonSelector::passPtCuts * NO inDetTrackParticle && muonSpectrometerTrackParticle && CombinedTrackParticle: " << std::endl;
292 ptID = pxMuonID ? pxMuonID->
pt() : 0.0 ;
293 ptMS = pxMuonMS ? pxMuonMS->
pt() : 0.0 ;
294 ptCB = pxMuonCB ? pxMuonCB->
pt() : 0.0 ;
297 if(
m_doDebug) std::cout <<
" * MuonSelector::passPtCuts * pt of each segments of this muon pxMuon: " <<
pt << std::endl
298 <<
" ptID: " << ptID << std::endl
299 <<
" ptMS: " << ptMS << std::endl
300 <<
" ptCB: " << ptCB << std::endl
301 <<
" fMEta pxMuon->eta(): " << fMEta << std::endl;
310 if(
m_doDebug) std::cout <<
" * MuonSelector::passPtCuts * this muon is in eta range |eta|= " << fMEta <<
" < EtaCut(" <<
m_fEtaCut <<
") " << std::endl
311 <<
" and passed the PtCuts (" <<
m_combPtCut <<
") "<< std::endl;
315 if(
m_doDebug) std::cout <<
" * MuonSelector::passPtCuts * this muon did not pass the PtCuts (reco pt=" <<
pt <<
") or Eta cut " <<
m_fEtaCut << std::endl;
325 std::cout <<
" * MuonSelector::passIsolCuts * WARNING * No isolation variable stored on the muon" << std::endl;
326 std::cout <<
" * MuonSelector::passIsolCuts * this muon did not pass the IsoCuts " << std::endl;
334 if(
m_doDebug) std::cout <<
" * MuonSelector::passIsolCuts * muon pt: " <<
pt <<
" ptSum(ptcone40): "<< ptSum << std::endl;
336 if(
m_doDebug) std::cout <<
" * MuonSelector::passIsolCuts * this muon passed the IsoCuts ptcone40 / pt= "
337 << ptSum <<
" / " <<
pt <<
" = " << ptSum /
pt
338 <<
" < IsoCut(" <<
m_IsoCut <<
") " << std::endl;
343 if(
m_doDebug) std::cout <<
" * MuonSelector::passIsolCuts * this muon did not pass the IsoCuts:" << std::endl;
358 if (
m_doDebug) std::cout <<
" * MuonSelector::passIPCuts * no IDTrk --> IP failure" << std::endl;
362 extz0 = IDTrk->
z0()+IDTrk->
vz();
364 std::cout <<
" * MuonSelector::passIPCuts *"
365 <<
" the IDTrack muon d0: " << extd0
366 <<
" the IDTrack muon z0: " << extz0 <<
" = " << IDTrk->
z0() <<
" + " << IDTrk->
vz() << std::endl;
370 if(
m_doDebug) std::cout <<
" * MuonSelector * passIPCuts() * no valid inDetTrackParticleLink(). Will use the combined muon IPs" << std::endl;
374 if(
m_doDebug) std::cout <<
" * MuonSelector * passIPCuts() * no valid CombinedTrackParticle. Giving up." << std::endl;
379 extz0 = CBTrk->
z0()+CBTrk->
vz();
381 std::cout <<
" * MuonSelector * passIPCuts() *"
382 <<
" the CBTrack muon d0: " << extd0
383 <<
" the CBTrack muon z0: " << extz0 <<
" = " << CBTrk->
z0() <<
" + " << CBTrk->
vz()<< std::endl;
392 if(
m_doDebug) std::cout <<
" * MuonSelector::passIPCuts ** fails because NO vertex collection "<< std::endl;
396 if ( vxContainer->
size()>1 ) {
398 std::cout <<
" * MuonSelector::passIPCuts ** vertex container is filled with " << vxContainer->
size() <<
" vertices" << std::endl;
401 for (
int ivtx=0; ivtx < (
int) vxContainer->
size(); ivtx++) {
403 std::cout <<
" vertex " << ivtx+1 <<
" (x,y,z) = (" << thisVtx->
position().x()
414 bool goodmuonIP =
false;
415 float minDeltaZ = 99999.;
417 for (
int ivtx=0; ivtx < (
int) vxContainer->
size(); ivtx++) {
421 if (std::abs(extz0 - thisVtx->
position().z()) < minDeltaZ) minDeltaZ = std::abs(extz0 - thisVtx->
position().z());
425 std::cout <<
" testing vtx: " << ivtx <<
" vtx.z= " << thisVtx->
position().z() <<
" trk.z= " << extz0 <<
" deltaZ= " << std::abs(extz0 - thisVtx->
position().z()) <<
" minDeltaZ= " << minDeltaZ << std::endl;
429 if(
m_doDebug) std::cout <<
" * MuonSelector::passIPCuts * this muon has passed the IPCuts for vertex " << ivtx+1
430 <<
" pVZcut= " << std::abs(extz0 - thisVtx->
position().z()) <<
" < " <<
m_diffZCut << std::endl
441 if(
m_doDebug) std::cout <<
" * MuonSelector::passIPCuts * this muon has passed the IPCuts. Zcut: "<<
m_pVZCut <<
" m_diffZCut " <<
m_diffZCut << std::endl;
446 if(
m_doDebug) std::cout <<
" * MuonSelector * passIPCuts() * this muon has not passed the IPCuts: " << std::endl;
454 std::cout <<
" * MuonSelector* -- STATS -- " << std::endl
461 std::cout <<
" passall : " <<
m_passall << std::endl
472 for_each (
newname.begin(),
newname.end(), [](
char &
c) {c = std::toupper(c);} );
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
bool isolation(float &value, const Iso::IsolationType information) const
Accessor for Isolation values.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
singleton-like access to IMessageSvc via open function and helper
@ expectBLayerHit
Do we expect a b-layer hit for this track? [unit8_t] (should be [bool])
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be NULL) to the TrackParticle used in identification of this muon.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
float vz() const
The z origin for the parameters.
unsigned char m_ucID_SCTCut
virtual double eta() const
The pseudorapidity ( ) of the particle.
float z0() const
Returns the parameter.
unsigned char m_ucID_TRTCut
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
const Amg::Vector3D & position() const
Returns the 3-pos.
VxType::VertexType vertexType() const
The type of the vertex.
@ numberOfBLayerHits
these are the hits in the first pixel layer, i.e.
IMessageSvc * getMessageSvc(bool quiet=false)
unsigned char m_ucID_PIXCut
float d0() const
Returns the parameter.
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
const xAOD::Muon * m_pxMuon
unsigned int m_uNumInstances
int m_requestedMuonQuality
virtual double pt() const
The transverse momentum ( ) of the particle.
unsigned char m_ucJMuon_Cut
unsigned int m_testedmuons
@ numberOfSCTHoles
number of SCT holes [unit8_t].
void SetMuonQualityRequirement(std::string newname)
std::string to_string(const DetectorType &type)
bool passSelection(const xAOD::Muon *pxMuon)
const ElementLink< TrackParticleContainer > & inDetTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
Class describing a Vertex.
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
virtual void BookHistograms()
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector [unit8_t].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Class describing a TrackParticle.
@ numberOfTRTHoles
number of TRT holes [unit8_t].
std::string m_xSampleName
size_type size() const noexcept
Returns the number of elements in the collection.