#include <SimpleTransport.h>
Inheritance diagram for photrans::SimpleTransport:
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 | |
int | msglevel |
the attenuation length in cm |
|
Definition at line 32 of file SimpleTransport.cxx. References jobc::Module::SetCfgVersion(). 00032 : 00033 PhotonTransporter(), 00034 jobc::Module("SimpleTransport"), 00035 fMeVToNPhot(0), 00036 fCollectionEff(0), 00037 fAttenLength(0) 00038 { 00039 this->SetCfgVersion(version); 00040 00041 }
|
|
Definition at line 45 of file SimpleTransport.cxx. 00046 { 00047 }
|
|
Reimplemented from jobc::Module. Definition at line 61 of file SimpleTransport.cxx. References edm::EventHandle::DAQ(), fAttenLength, fCollectionEff, fMeVToNPhot, edm::EventHandle::Header(), geo::Geometry::Instance(), msglevel, photrans::PhotonSignal::NPhoton(), edm::EventHandle::Raw(), photrans::PhotonSignal::SetPlaneCell(), and photrans::PhotonSignal::SetTrackId(). 00062 { 00063 00064 std::vector<const rawdata::DAQHeader*> header; 00065 short int det = rawdata::kFar; 00066 try{ evt.DAQ().Get("./",header); } 00067 catch(edm::Exception e){ 00068 std::cerr << "Error retrieving daq header, while looking "<< 00069 "in SimpleTransport::Reco(), using default fardet geometry" << std::endl; 00070 } 00071 if(header.size() > 0) det = header[0]->DetId(); 00072 geo::Geometry& fGeo = geo::Geometry::Instance(evt.Header().Run(), det); 00073 00074 vector<const sim::FLSHitList*> hitlist(0); 00075 sim::TruthFilter::GetFilteredHits(evt,hitlist); 00076 vector<photrans::PhotonSignal> photlist(0); 00077 00078 int nhits = 0; 00079 00080 int planeId = -1; 00081 int cellId = -1; 00082 00083 float fGeVToMeV = 1000.; 00084 00085 //geo::CellUniqueId lastuid; 00086 00087 for (unsigned int i=0; i<hitlist.size(); ++i) { 00088 00089 // geo::CellUniqueId uid; 00090 00091 float edep = 0.; 00092 double time = 0.; 00093 00094 float dist=0.; 00095 00096 unsigned short trkid = 0; 00097 00098 for (unsigned int j=0; j< hitlist[i]->fHits.size(); ++j) { 00099 ++nhits; 00100 00101 // uid = hitlist[i]->fHits[j].fId; 00102 00103 //if(!(lastuid==uid)) 00104 if(planeId!=hitlist[i]->fHits[j].fPlaneId || cellId!=hitlist[i]->fHits[j].fCellId) 00105 try{ 00106 00107 planeId=hitlist[i]->fHits[j].fPlaneId; 00108 cellId=hitlist[i]->fHits[j].fCellId; 00109 //cout <<"plane = "<<planeId<<endl; 00110 //cout << "("<<planeId<<","<<cellId<<") (" << hitlist[i]->fHits[j].fPlaneId<<","<<hitlist[i]->fHits[j].fCellId<<")"<<endl; 00111 // if (&cell == 0) continue; 00112 // cout << "cell = " << cellId << endl; 00113 // cellHalfLength = cell.HalfL(); 00114 00115 // cout << "cell Half length = " << cellHalfLength << endl; 00116 // lastuid=uid; 00117 }catch(...){printf("bad photon geometry\n");continue;} 00118 00119 00120 edep = hitlist[i]->fHits[j].fEdep; 00121 time = hitlist[i]->fHits[j].fT; 00122 // double pos1[3] = {0.,0.,hitlist[i]->fHits[j].fEntryZ()}; 00123 // double pos2[3]; 00124 // cell.WorldToLocal(pos1,pos2); 00125 00126 dist = fGeo. 00127 Plane((unsigned int)planeId). 00128 Cell((unsigned int)cellId). 00129 DistToReadOut(0.5*(hitlist[i]->fHits[j].fEntryZ + 00130 hitlist[i]->fHits[j].fExitZ)); 00131 trkid = hitlist[i]->fHits[j].fTrackId; 00132 00133 photrans::PhotonSignal 00134 photon(time,int(edep*fMeVToNPhot*fGeVToMeV*fCollectionEff*exp(-dist/fAttenLength))); 00135 photon.SetPlaneCell(planeId, cellId); 00136 photon.SetTrackId(trkid); 00137 00138 if(photon.NPhoton() > 0.) photlist.push_back(photon); 00139 00140 } 00141 00142 } 00143 00144 if(msglevel>=INFO)cout << "Read " << nhits << " FLS hits" << endl; 00145 if(msglevel>=INFO)cout << "Created " << photlist.size() << " photon signals" << endl; 00146 00147 for (unsigned int i=0; i<photlist.size(); ++i) 00148 evt.Raw().Put(photlist[i],""); 00149 00150 photlist.clear(); 00151 00152 return jobc::kPassed; 00153 00154 }
|
|
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 }
|
|
normalization factor
Definition at line 42 of file SimpleTransport.h. |
|
conversion factor MeV->NPhoton
Definition at line 41 of file SimpleTransport.h. |
|
Definition at line 40 of file SimpleTransport.h. |
|
the attenuation length in cm
Definition at line 44 of file SimpleTransport.h. |