//-------------------------------------------------------------------------- // File and Version Information: // $Id: FsmEmcFwCap.cc,v 1.9 2007/05/24 08:07:40 klausg Exp $ // // Description: // Class FsmEmcFwCap // // Implementation of the EMC Barrel part for the FastSim // // This software was developed for the PANDA collaboration. If you // use all or part of it, please give an appropriate acknowledgement. // // Author List: // Klaus Goetzen Original Author // // Copyright Information: // Copyright (C) 2006 GSI // //------------------------------------------------------------------------ //----------------------- // This Class's Header -- //----------------------- #include "PndFsmEmcFwCap.h" //------------- // C Headers -- //------------- //--------------- // C++ Headers -- //--------------- #include #include using std::cout; using std::endl; using std::ostream; using std::string; //------------------------------- // Collaborating Class Headers -- //------------------------------- #include "ArgList.h" #include "PndFsmResponse.h" #include "PndFsmTrack.h" //----------------------------------------------------------------------- // Local Macros, Typedefs, Structures, Unions and Forward Declarations -- //----------------------------------------------------------------------- //---------------- // Constructors -- //---------------- PndFsmEmcFwCap::PndFsmEmcFwCap() { initParameters(); _thtMin=_thtMin*M_PI/180.0; _thtMax=_thtMax*M_PI/180.0; print(std::cout); } PndFsmEmcFwCap::PndFsmEmcFwCap(ArgList &par) { initParameters(); //set default parameter values and parses a parameter list //i.e. std::list of the form //"a=1" "b=2" "c=3" parseParameterList(par); _thtMin=_thtMin*M_PI/180.0; _thtMax=_thtMax*M_PI/180.0; print(std::cout); } //-------------- // Destructor -- //-------------- PndFsmEmcFwCap::~PndFsmEmcFwCap() { } //-------------- // Operations -- //-------------- PndFsmResponse* PndFsmEmcFwCap::respond(PndFsmTrack *t) { PndFsmResponse *result=new PndFsmResponse(); result->setDetector(this); bool wasDetected=detected(t); result->setDetected(wasDetected); if (wasDetected && fabs(t->charge())<1e-8) { result->setdE(dE(t)); result->setdphi(dphi(t)); result->setdtheta(dtheta(t)); } else { result->setdE(0.); result->setdphi(0.); result->setdtheta(0.); } return result; } bool PndFsmEmcFwCap::detected(PndFsmTrack *t) const { if (t->hitMapValid()) { return t->hitMapResponse(FsmDetEnum::EmcFwCap); } else { double theta = t->p4().Theta(); double E=t->p4().E(); double lund = t->pdt(); return ( lund==22 && theta>=_thtMin && theta<=_thtMax && E>_Emin && _rand->Rndm()<=_efficiency); } } double PndFsmEmcFwCap::dE(PndFsmTrack *t) const { double E = t->p4().E(); return (_aPar+_bPar/E+_cPar/sqrt(E) ) * E; } double PndFsmEmcFwCap::dphi(PndFsmTrack *t) const { double theta = t->p4().Vect().Theta(); return (_resFactor*M_PI/int(2*M_PI*_dist*tan(theta)/_xtalDim) ); } double PndFsmEmcFwCap::dtheta(PndFsmTrack *t) const { double theta = t->p4().Vect().Theta(); return ( _resFactor*atan(_xtalDim*cos(theta)/(2*_dist)) ); } void PndFsmEmcFwCap::print(ostream &o) { o <<"Detector <"<<_detName<<">"<