Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

MuonObserver Struct Reference

List of all members.

Public Methods

 MuonObserver ()
 ~MuonObserver ()
void upDate (G3SetUp *su)
void upDate (G3EventProxy *ev)

Public Attributes

int nbMuons_
double momentumSum_
SimpleConfigurable< bool > produceReference_
SimpleConfigurable< string > muonReconstructorName_
TrackReconstructor * muonReconstructor_

Constructor & Destructor Documentation

MuonObserver::MuonObserver   [inline]
 

Definition at line 43 of file XANAMuons.cpp.

References momentumSum_, muonReconstructor_, muonReconstructorName_, nbMuons_, and produceReference_.

00044    : nbMuons_(0), momentumSum_(0), muonReconstructor_(0)
00045    { 
00046     // initialize observer
00047     Observer<G3EventProxy *>::init() ;      
00048     Observer<G3SetUp *>::init() ;
00049     
00050     // steering
00051     produceReference_=SimpleConfigurable<bool>(false,"XANAMuons:ProduceReference");
00052     muonReconstructorName_=
00053      SimpleConfigurable<string>("GlobalMuonReconstructor","XANAMuons:MuonReconstructor");
00054     // initialisation of muoning algo must be done in observing G3SetUp       
00055    }

MuonObserver::~MuonObserver   [inline]
 

Definition at line 57 of file XANAMuons.cpp.

References momentumSum_, muonReconstructor_, nbMuons_, and xana::out.

00058    {
00059     delete muonReconstructor_;
00060     xana::out(1)<<"[OVAL] number of muons : "<<nbMuons_<<endl ;
00061     xana::out(1)<<"[OVAL] mean energy : "<<momentumSum_/nbMuons_<<endl ;
00062    }


Member Function Documentation

void MuonObserver::upDate G3EventProxy *    ev [inline]
 

Definition at line 76 of file XANAMuons.cpp.

References momentumSum_, muonReconstructorName_, nbMuons_, xana::out, XANATrack::setAlgoName, XANATrack::setCharge, XANAMuonCandidate::setCharge, XANATrack::setChi2OverDof, XANATrack::setImpactParameter, XANATrack::setLongImpactParameter, XANATrack::setMomentumAtFirstPoint, XANATrack::setMomentumAtLastPoint, XANATrack::setMomentumAtVertex, XANAMuonCandidate::setMuonTrack, XANATrack::setNumberOfHits, XANATrack::setNumberOfLostHits, XANATrack::setPositionAtFirstPoint, XANATrack::setPositionAtLastPoint, and XANATrack::setTransImpactParameter.

00077    { 
00078     
00079     if (!ev) return ;    
00080     
00081     RecItr<TTrack> muon(ev->recEvent(),muonReconstructorName_.value().c_str());
00082     
00083     // to produce reference
00084     double momentum=0.;
00085     if (produceReference_) {
00086       while (muon.next()) {
00087         TrajectoryStateOnSurface ts = (*muon).impactPointState() ;
00088         if (ts.isValid()) {
00089           momentum = ts.globalMomentum().mag() ;
00090           nbMuons_++ ;
00091           momentumSum_ += momentum ;
00092           cout<<"[OVAL] new muon with momentum "<<momentum<<flush ;
00093           cout<<" and impact parameter "<<muon->impactParameter3D().value()<<endl ;
00094          }  
00095       }
00096       return ;
00097     } 
00098     
00099     // construct XANAmuons from Tmuons
00100     vector<XANAMuonCandidate> xmuons;
00101     XANAMuonCandidate *xmuon=0;
00102     while (muon.next()) { 
00103       TrajectoryStateOnSurface ts = (*muon).impactPointState() ;
00104       if (ts.isValid()) {
00105         momentum = ts.globalMomentum().mag() ;
00106         nbMuons_++ ;
00107         momentumSum_ += momentum ;
00108       }        
00109       cout << "Found new muon with momentum : "<<momentum<<endl ; 
00110       TrajectoryStateOnSurface tsi = (*muon).innermostState() ;
00111       TrajectoryStateOnSurface tso = (*muon).outermostState() ;
00112       HepVector3D momentumAtVertex(muon->momentumAtVertex().x(), 
00113        muon->momentumAtVertex().y(),muon->momentumAtVertex().z());
00114       HepPoint3D firstHit(tsi.globalPosition().x(),tsi.globalPosition().y(),
00115         tsi.globalPosition().z()); 
00116       HepVector3D momentumAtFirst(tsi.globalMomentum().x(),tsi.globalMomentum().y(),
00117         tsi.globalMomentum().z());
00118       HepPoint3D lastHit(tso.globalPosition().x(),tso.globalPosition().y(),
00119         tso.globalPosition().z()); 
00120       HepVector3D momentumAtLast(tso.globalMomentum().x(),tso.globalMomentum().y(),
00121         tso.globalMomentum().z());
00122       xmuon = new XANAMuonCandidate();
00123       HepLorentzVector momentum(muon->momentumAtVertex().x(), 
00124        muon->momentumAtVertex().y(),muon->momentumAtVertex().z(),
00125        muon->momentumAtVertex().mag());
00126       xmuon->setMomentum(momentum);
00127       xmuon->setPt(momentum.perp());
00128       xmuon->setCharge(muon->charge());
00129       XANAMuonTrack *xmuontrack = new XANAMuonTrack();
00130       xmuontrack->setCharge(muon->charge()); 
00131       xmuontrack->setChi2OverDof(muon->normalisedChiSquared());
00132       xmuontrack->setNumberOfHits(muon->foundHits());
00133       xmuontrack->setNumberOfLostHits(muon->lostHits());
00134       xmuontrack->setImpactParameter(muon->impactParameter3D().value());
00135       xmuontrack->setLongImpactParameter(muon->zImpactParameter().value());
00136       xmuontrack->setTransImpactParameter(muon->transverseImpactParameter().value());
00137       xmuontrack->setMomentumAtVertex(momentumAtVertex);
00138       xmuontrack->setPositionAtFirstPoint(firstHit);
00139       xmuontrack->setMomentumAtFirstPoint(momentumAtFirst);
00140       xmuontrack->setPositionAtLastPoint(lastHit);
00141       xmuontrack->setMomentumAtLastPoint(momentumAtLast);
00142       xmuontrack->setAlgoName(muonReconstructorName_.value());
00143       xmuon->setMuonTrack(xmuontrack);
00144       xmuons.push_back(*xmuon);
00145     }
00146      
00147     // read XANAmuons 
00148     vector<XANAMuonCandidate>::iterator it;
00149     for (it=xmuons.begin(); it!=xmuons.end(); it++)  
00150      {
00151       xana::out(1)<<"[OVAL] new muon with transverse momentum "<<it->getMuonTrack()->getMomentumAtVertex().perp()<<flush ;
00152       xana::out(1)<<" and impact parameter "<<it->getMuonTrack()->getImpactParameter()<<endl ;
00153      }
00154    }

void MuonObserver::upDate G3SetUp *    su [inline]
 

Definition at line 68 of file XANAMuons.cpp.

00069    {    
00070     // defines muon reconstruction algo  
00071     // muon reconstructor initialisation can be done in the event loop as well
00072     L1MuGMTSetup* setup = Singleton<L1MuGMTSetup>::instance();
00073 
00074    }


Member Data Documentation

double MuonObserver::momentumSum_
 

Definition at line 38 of file XANAMuons.cpp.

Referenced by MuonObserver, upDate, and ~MuonObserver.

TrackReconstructor* MuonObserver::muonReconstructor_
 

Definition at line 41 of file XANAMuons.cpp.

Referenced by MuonObserver, and ~MuonObserver.

SimpleConfigurable<string> MuonObserver::muonReconstructorName_
 

Definition at line 40 of file XANAMuons.cpp.

Referenced by MuonObserver, and upDate.

int MuonObserver::nbMuons_
 

Definition at line 37 of file XANAMuons.cpp.

Referenced by MuonObserver, upDate, and ~MuonObserver.

SimpleConfigurable<bool> MuonObserver::produceReference_
 

Definition at line 39 of file XANAMuons.cpp.

Referenced by MuonObserver.


The documentation for this struct was generated from the following file:
Generated on Tue May 10 10:01:37 2005 for XANADOO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002