Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ]   [ 15.*.* ] 

001 // MuonMisalignmentReconstructor.cxx
002 //
003 // Implementation of muon misalignment corrections 
004 // measured by Clement
005 //
006 // Authors: Clement Helsens, Simon Dean
007 //
008 
009 #include "AtlfastAlgs/MuonMisalignmentReconstructor.h"
010 #include "AtlfastAlgs/GlobalEventData.h"
011 #include <cmath>
012 
013 #include "CLHEP/Vector/LorentzVector.h"
014 #include "CLHEP/Units/SystemOfUnits.h"  
015 #include "CLHEP/Random/JamesRandom.h"
016 #include "CLHEP/Random/RandGauss.h"
017 #include <iostream>
018 
019 #include "PathResolver/PathResolver.h"
020 
021 //-------------------------------------------------------------
022   /** @brief Provides misalignment corrections for muons
023    *
024    */
025 
026 namespace Atlfast {
027   using std::abs;
028   using std::pair;
029   
030   
031   // MuonMisalignmentReconstructor methods
032   
033   /** Constructor called from Athena code */
034   MuonMisalignmentReconstructor::MuonMisalignmentReconstructor(const ProblematicRegion& pbr): 
035     IAcceptingReconstructor(), DefaultReconstructor(12345), m_pbr(pbr)
036   {
037 
038 
039     //get the Global Event Data using singleton pattern
040     GlobalEventData* ged = GlobalEventData::Instance();
041     //int randSeed =   ged->randSeed();
042     //DefaultReconstructor(randSeed);
043 
044     m_muonMisalignment = ged->muonMisalignment();
045 
046     std::string filenameAlign =
047       PathResolver::find_file(ged->muonAlignFileName(), "DATAPATH");
048     std::cout << "MuonMisalignmentReconstructor getting file for alignment" 
049               << filenameAlign << std::endl;
050     
051     std::string filenameAlignLinearFit =
052       PathResolver::find_file(ged->muonLinearFitAlignFileName(), "DATAPATH");
053     std::cout << "MuonMisalignmentReconstructor getting file for alignment linear fit" 
054               << filenameAlignLinearFit << std::endl;
055     
056     if (filenameAlignLinearFit!="" && filenameAlign!="")
057       m_muonMisalCalculator = 
058         new MuonMisalignmentCalculator(filenameAlign.c_str(), filenameAlignLinearFit.c_str());
059     else
060       std::cout << "Could not open muon resolution file for alignment!!" << std::endl;
061     
062   }
063   
064   MuonMisalignmentReconstructor::~MuonMisalignmentReconstructor()
065   {}
066   
067   /** reconstruct method for ReconstructedParticle */ 
068   ReconstructedParticle MuonMisalignmentReconstructor::reconstruct( const ReconstructedParticle &particle )const{
069     
070     const HepLorentzVector avec(particle.px(),particle.py(),particle.pz(),particle.e());
071     double sigma =  resolMSAlign(avec).first;
072     if (sigma == -1.){ 
073       return particle;
074     } 
075 
076     HepLorentzVector bvec = avec/(fabs(1.0+sigma));    
077     ReconstructedParticle return_particle(particle);
078     return_particle.set_momentum(bvec);
079     
080     if ( sigma < -1.){
081       return_particle.set_recoCharge(-1*return_particle.recoCharge());
082     }
083     
084     return return_particle; 
085     
086   }
087   
088   pair<double, double> MuonMisalignmentReconstructor::resolMSAlign(const HepLorentzVector& avec) const {
089     
090     if (!m_muonMisalCalculator)
091       std::cout << "No MuonMisalignmentCalculator, resolution set to 0.0" << std::endl;
092     double sigmamuon = m_muonMisalCalculator ?
093       m_muonMisalCalculator->calculateResoAlignLinearFit(avec, m_muonMisalignment) : 0.;
094     if (!sigmamuon){
095       std::cout << "Zero spectrometer resolution for the alignment!!!" << std::endl;
096       pair<double, double>  sigmapr(0,0);
097       return sigmapr;
098     }
099     double sigmamuonRel = sigmamuon*avec.perp();
100     double aa=m_randGauss->fire();
101     double sigmams   = aa*sigmamuonRel;
102     pair<double, double> sigmapr(sigmams, sigmamuonRel);
103     
104     return sigmapr;
105   }
106     
107 } // end of namespace bracket
108 

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!