Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

photrans::SimpleTransport Class Reference

#include <SimpleTransport.h>

Inheritance diagram for photrans::SimpleTransport:

photrans::PhotonTransporter jobc::Module cfg::Observer List of all members.

Public Member Functions

 SimpleTransport (const char *version)
void Update (const cfg::Config &c)
virtual ~SimpleTransport ()
jobc::Result Reco (edm::EventHandle &evt)

Private Attributes

float fMeVToNPhot
float fCollectionEff
 conversion factor MeV->NPhoton
float fAttenLength
 normalization factor
geo::GeometryfGeo
 the attenuation length in cm
int msglevel

Constructor & Destructor Documentation

SimpleTransport::SimpleTransport const char *  version  ) 
 

Definition at line 31 of file SimpleTransport.cxx.

References jobc::Module::SetCfgVersion().

00031                                                     : 
00032   PhotonTransporter(), 
00033   jobc::Module("SimpleTransport"),
00034   fMeVToNPhot(0), fAttenLength(0), fCollectionEff(0),
00035   fGeo(0)
00036 {
00037   this->SetCfgVersion(version);
00038   
00039 }

SimpleTransport::~SimpleTransport  )  [virtual]
 

Definition at line 43 of file SimpleTransport.cxx.

00044 {
00045   if (fGeo)
00046     delete fGeo;
00047 }


Member Function Documentation

jobc::Result SimpleTransport::Reco edm::EventHandle evt  )  [virtual]
 

Reimplemented from jobc::Module.

Definition at line 61 of file SimpleTransport.cxx.

References assert_jobc, edm::EventHandle::DAQ(), edm::EventHandle::DetSim(), fAttenLength, fCollectionEff, fGeo, fMeVToNPhot, edm::EventHandle::Header(), geo::Geometry::Instance(), msglevel, photrans::PhotonSignal::NPhoton(), edm::EventHandle::Raw(), photrans::PhotonTransporter::SeedOnEvent(), photrans::PhotonSignal::SetPlaneCell(), and photrans::PhotonSignal::SetTrackId().

00062 {
00063   
00064   if (!fGeo){
00065     std::vector<const rawdata::DAQHeader*> header;
00066     short int det = rawdata::kFar;
00067     try{ evt.DAQ().Get("./",header); }
00068     catch(edm::Exception e){
00069       std::cerr << "Error retrieving daq header, while looking "<<
00070         "in CalHit::Raw(), using default fardet geometry" << std::endl;
00071     }
00072     if(header.size() > 0) det = header[0]->DetId();
00073 
00074     fGeo = &geo::Geometry::Instance(evt.Header().Run(), det);
00075   }
00076 
00077   //Setup the random numbers
00078   SeedOnEvent(evt);
00079   
00080   vector<const sim::FLSHitList*> hitlist(0);
00081   vector<photrans::PhotonSignal> photlist(0);
00082   
00083   assert_jobc(evt.DetSim().Get("./",hitlist),
00084               "No FLSHitLists found in DetSim() folder!");
00085 
00086   int nhits = 0;
00087   
00088   int planeId = -1;
00089   int cellId  = -1;
00090 
00091   float fGeVToMeV = 1000.;
00092   
00093   //geo::CellUniqueId lastuid;
00094   
00095   for (unsigned int i=0; i<hitlist.size(); ++i) {
00096     
00097     //  geo::CellUniqueId uid;
00098     
00099     float edep = 0.;
00100     float time = 0.;
00101 
00102     float dist=0.;
00103 
00104     unsigned short trkid = 0;    
00105      
00106     for (unsigned int j=0; j< hitlist[i]->fHits.size(); ++j) {
00107       ++nhits;
00108       
00109       //      uid = hitlist[i]->fHits[j].fId;
00110       
00111       //if(!(lastuid==uid))
00112       if(planeId!=hitlist[i]->fHits[j].fPlaneId || cellId!=hitlist[i]->fHits[j].fCellId)
00113         try{     
00114           //const geo::CellGeo cell = fGeo->IdToCell(uid, &planeId, &cellId);
00115           
00116           planeId=hitlist[i]->fHits[j].fPlaneId;
00117           cellId=hitlist[i]->fHits[j].fCellId;
00118           //cout <<"plane = "<<planeId<<endl;
00119           //cout << "("<<planeId<<","<<cellId<<")    (" << hitlist[i]->fHits[j].fPlaneId<<","<<hitlist[i]->fHits[j].fCellId<<")"<<endl;
00120           //  if (&cell == 0) continue;
00121           //    cout << "cell = " << cellId << endl;
00122           //    cellHalfLength = cell.HalfL();
00123 
00124           //  cout << "cell Half length = " << cellHalfLength << endl;
00125           //    lastuid=uid;
00126         }catch(...){printf("bad photon geometry\n");continue;}
00127       
00128       
00129       edep = hitlist[i]->fHits[j].fEdep;
00130       time = hitlist[i]->fHits[j].fT;
00131       //      double pos1[3] = {0.,0.,hitlist[i]->fHits[j].fEntryZ()};
00132       //      double pos2[3];
00133       //      cell.WorldToLocal(pos1,pos2);
00134       dist = fGeo->
00135         Plane((unsigned int)planeId).
00136         Cell((unsigned int)cellId).
00137         DistToReadOut(0.5*(hitlist[i]->fHits[j].fEntryZ + 
00138                            hitlist[i]->fHits[j].fExitZ));
00139       trkid =  hitlist[i]->fHits[j].fTrackId;
00140 
00141       photrans::PhotonSignal 
00142         photon(time,0.,int(edep*fMeVToNPhot*fGeVToMeV*fCollectionEff*exp(-dist/fAttenLength)));
00143       photon.SetPlaneCell(planeId, cellId);
00144       photon.SetTrackId(trkid);
00145       
00146       if(photon.NPhoton() > 0.) photlist.push_back(photon);
00147       
00148     }
00149     
00150   }
00151 
00152   if(msglevel>=INFO)cout << "Read " << nhits << " FLS hits" << endl;
00153   if(msglevel>=INFO)cout << "Created " << photlist.size() << " photon signals" << endl;
00154   
00155   for (unsigned int i=0; i<photlist.size(); ++i)
00156     evt.Raw().Put(photlist[i],"");
00157   
00158   photlist.clear();
00159 
00160   return jobc::kPassed;
00161 
00162 }

void SimpleTransport::Update const cfg::Config c  )  [virtual]
 

Implements cfg::Observer.

Definition at line 51 of file SimpleTransport.cxx.

References fAttenLength, fCollectionEff, fMeVToNPhot, and msglevel.

00052 {
00053   c("MeVToNPhot").   Get(fMeVToNPhot);
00054   c("CollectionEff").Get(fCollectionEff);
00055   c("AttenLength").  Get(fAttenLength);
00056   c("MessageLevel"). Get(msglevel);
00057 }


Member Data Documentation

float photrans::SimpleTransport::fAttenLength [private]
 

normalization factor

Definition at line 42 of file SimpleTransport.h.

Referenced by Reco(), and Update().

float photrans::SimpleTransport::fCollectionEff [private]
 

conversion factor MeV->NPhoton

Definition at line 41 of file SimpleTransport.h.

Referenced by Reco(), and Update().

geo::Geometry* photrans::SimpleTransport::fGeo [private]
 

the attenuation length in cm

Definition at line 43 of file SimpleTransport.h.

Referenced by Reco().

float photrans::SimpleTransport::fMeVToNPhot [private]
 

Definition at line 40 of file SimpleTransport.h.

Referenced by Reco(), and Update().

int photrans::SimpleTransport::msglevel [private]
 

Definition at line 45 of file SimpleTransport.h.

Referenced by Reco(), and Update().


The documentation for this class was generated from the following files:
Generated on Wed Oct 15 02:35:32 2008 for NOvA Offline by  doxygen 1.3.9.1