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 #include "AtlfastAlgs/ReconstructorFactory.h"
002 #include "AtlfastAlgs/CompoundReconstructor.h"
003 #include "AtlfastAlgs/ParticleSubsystemPartitionTool.h"
004 #include "AtlfastAlgs/DefaultReconstructor.h"
005 #include "AtlfastAlgs/ElectronReconstructor.h"
006 #include "AtlfastAlgs/MuonReconstructor.h"
007 #include "AtlfastAlgs/MuonMisalignmentReconstructor.h"
008 #include "AtlfastAlgs/PhotonReconstructor.h"
009 
010 namespace Atlfast{
011   ReconstructorFactory::ReconstructorFactory(std::string fileName,MsgStream &log):m_log(log),m_fl(fileName){
012     /////////////////////////////////////////////////////////////////////////////////////////////////////////
013     //To Add New Reconstructors Follow Instructions Below...
014     /////////////////////////////////////////////////////////////////////////////////////////////////////////
015     //step 1)
016     //add lines like example below for adding mapping of PROBLEM to marginal and replacement reconstructors
017     //all new reconstructors must be able to take a single construction arguement that is a ProblematicRegion
018     //which will contain the smearing parameters and the acceptance criteria.
019     //example:
020     //    m_reconstructorTypeMap[DetectorParameters::Scaling] = &smearerForge<testReconstructor>;
021     /////////////////////////////////////////////////////////////////////////////////////////////////////////
022     m_reconstructorTypeMap[DetectorParameters::Misalignment] = &reconstructorForge<MuonMisalignmentReconstructor>;
023                                                                
024     /////////////////////////////////////////////////////////////////////////////////////////////////////////
025     //step 2)
026     // Below we set up the mapping of particle pdgID to SUBSYSTEMs that affect it.
027     /////////////////////////////////////////////////////////////////////////////////////////////////////////
028     m_particleSubsystemMap.insert(std::pair<int,DetectorParameters::SUBSYSTEM>(11,DetectorParameters::Calorimeter));
029     m_particleSubsystemMap.insert(std::pair<int,DetectorParameters::SUBSYSTEM>(13,DetectorParameters::Calorimeter));
030     m_particleSubsystemMap.insert(std::pair<int,DetectorParameters::SUBSYSTEM>(13,DetectorParameters::MuonSystem));
031    
032   }
033 
034   IReconstructor* ReconstructorFactory::makeReconstructor(   int particleType,
035                                                              const int randSeed, 
036                                                              const int lumi, 
037                                                              const int muSmearKey, 
038                                                              std::string& muonResFile, 
039                                                              std::vector<double> smearParamArray, 
040                                                              int smearParamSchema )const{
041 
042     // A) firstly set up the compound reconstructor with the default reconstructor
043     IDefaultReconstructor *defaultReconstructor;
044 
045     if (particleType == 11) 
046       {
047         m_log << MSG::DEBUG << "Creating new ElectronReconstructor randSeed: "<<randSeed<<" lumi: "<<lumi<<endreq;
048         defaultReconstructor = new ElectronReconstructor(randSeed, lumi, m_log);
049       } 
050     else if (particleType == 13) 
051       {
052         m_log << MSG::DEBUG << "Creating new MuonReconstructor randSeed: "<<randSeed<<" lumi: "<<lumi<<endreq;
053         m_log << MSG::DEBUG << "                         smearKey: "<<muSmearKey<<" resFile: "<<muonResFile<<endreq;
054         defaultReconstructor = new MuonReconstructor(randSeed, lumi, muSmearKey, muonResFile, m_log);
055       } 
056     else if (particleType == 22) 
057       {
058         m_log << MSG::DEBUG << "Creating new PhotonReconstructor randSeed: "<<randSeed<<" lumi: "<<lumi<<endreq;
059         defaultReconstructor = new PhotonReconstructor(randSeed, lumi, m_log);
060       } 
061     else 
062       {
063         m_log << MSG::DEBUG << "Creating new DefaultReconstructor randSeed: "<<randSeed<<endreq;
064         defaultReconstructor = new DefaultReconstructor(randSeed);
065       }
066     defaultReconstructor->setSmearParameters(smearParamArray);
067     defaultReconstructor->setSmearParamSchema(smearParamSchema);
068     CompoundReconstructor *compoundReconstructor = new CompoundReconstructor(defaultReconstructor);
069 
070     // B) now add marginal and replacement reconstructors that apply for the given particleType
071    m_log << MSG::DEBUG << "Partitioning problematic regions."<<endreq;
072    std::vector<const ProblematicRegion*> pbr(m_fl.GetRegions());//need to copy to a new one as partition re-orders i.e. not const
073    std::vector<const ProblematicRegion*>::iterator itr, start, end, bound;
074    start = pbr.begin();
075    end = pbr.end();
076    ParticleSubsystemPartitionTool ptp(particleType,m_particleSubsystemMap);
077    bound = std::partition(start, end, ptp); //now sorted into those that affect particle 
078                                             //and those that dont
079    
080    m_log << MSG::DEBUG << "Adding defined replacement/marginal reconstructor to compound reconstructor."<<endreq;
081    std::map<DetectorParameters::PROBLEM,reconstructorForgePointer>::const_iterator mItr;
082    for(itr=pbr.begin();itr!=bound;++itr){
083      mItr = m_reconstructorTypeMap.find((*itr)->problem());
084      if(mItr!=m_reconstructorTypeMap.end()){
085        IAcceptingReconstructor *ias = mItr->second(**itr);
086        if(ias->is_replacement()){ compoundReconstructor->addReplacement(ias); }
087        else{ compoundReconstructor->addMarginal(ias); }
088      }
089      else{
090        m_log<<MSG::ERROR<<"ReconstructorFactory: You shouldn't be seeing this message. If you are then no mapping has been"<<endreq;
091        m_log<<MSG::ERROR<<"                      established between your chosen PROBLEM type and a concrete reconstructor implementation!"<<endreq;
092        assert(false);
093      }
094    }
095 
096    m_log << MSG::DEBUG << "Returning CompoundReconstructor."<<endreq;
097    return compoundReconstructor;
098   }
099   
100 
101 }//end of namespace
102 

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!