All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
icarus::TrigInfo Class Reference
Inheritance diagram for icarus::TrigInfo:

Public Member Functions

 TrigInfo (fhicl::ParameterSet const &p)
 
 TrigInfo (TrigInfo const &)=delete
 
 TrigInfo (TrigInfo &&)=delete
 
TrigInfooperator= (TrigInfo const &)=delete
 
TrigInfooperator= (TrigInfo &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 

Private Attributes

TTree * fTree
 
int event
 
int event_type
 
int is_Neutrino
 
int Neutrino_Interaction
 
int noPMT [nPMTs]
 
int turned_PMT
 
double PMTx [nPMTs]
 
double PMTy [nPMTs]
 
double PMTz [nPMTs]
 
int Cryostat [nPMTs]
 
int TPC [nPMTs]
 
float photons_collected [nPMTs]
 
float QE_photons_collected [nPMTs]
 
float photon_time [nPMTs][MaxPhotons]
 
float firstphoton_time [nPMTs]
 
int nHit
 
double hit_peaktime [nPMTs]
 
double hit_width [nPMTs]
 
double hit_area [nPMTs]
 
double hit_peak [nPMTs]
 
double hit_phe [nPMTs]
 
float true_barycentre_x
 
float true_barycentre_y
 
float true_barycentre_z
 
double vertex_x
 
double vertex_y
 
double vertex_z
 
float reco_barycentre_y
 
float reco_barycentre_z
 
float total_quenched_energy
 
float total_coll_photons
 
float PMT_error_y
 
float PMT_error_z
 
float PMT_total_error
 
art::InputTag photonLabel
 
art::InputTag chargeLabel
 
art::InputTag typoLabel
 
art::InputTag hitLabel
 

Detailed Description

Definition at line 88 of file TrigInfo_module.cc.

Constructor & Destructor Documentation

icarus::TrigInfo::TrigInfo ( fhicl::ParameterSet const &  p)
explicit

Definition at line 170 of file TrigInfo_module.cc.

171  :
172  EDAnalyzer(p),
173  photonLabel(p.get<art::InputTag>("fottoni", "largeant")),
174  chargeLabel(p.get<art::InputTag>("carconi", "largeant")),
175  typoLabel (p.get<art::InputTag>("tiponi", "generator")),
176  hitLabel (p.get<art::InputTag>("hittoni", "ophit"))
177  // More initializers here.
178 {
179 
180 }
art::InputTag hitLabel
pdgs p
Definition: selectors.fcl:22
art::InputTag photonLabel
art::InputTag chargeLabel
art::InputTag typoLabel
icarus::TrigInfo::TrigInfo ( TrigInfo const &  )
delete
icarus::TrigInfo::TrigInfo ( TrigInfo &&  )
delete

Member Function Documentation

void icarus::TrigInfo::analyze ( art::Event const &  e)
override

Definition at line 183 of file TrigInfo_module.cc.

184 {
185 
186 ////////////////////////////////// Create the LArsoft services and service handle//////////////////////////////
187 
188 art::ServiceHandle<geo::Geometry> geom;
189 
190 std::vector<sim::SimPhotons> const& optical = *(evt.getValidHandle<std::vector<sim::SimPhotons>>(photonLabel));
191 std::vector<sim::SimChannel> const& charge = *(evt.getValidHandle<std::vector<sim::SimChannel>>(chargeLabel));
192 std::vector<recob::OpHit> const& hit = *(evt.getValidHandle<std::vector<recob::OpHit>>(hitLabel));
193 //std::vector<simb::MCTruth> const& type = *(evt.getValidHandle<std::vector<simb::MCTruth>>(typoLabel));
194 
195 ////////////////////////////////// Event number//////////////////////////////
196 
197 event = evt.id().event();
198 
199 //std::vector< art::Handle< std::vector<simb::MCTruth> > > type;
200 //evt.getManyByType(type);
201 auto type = evt.getMany< std::vector<simb::MCTruth> >();
202 
203 for(size_t mcl = 0; mcl < type.size(); ++mcl)
204 {
205  art::Handle< std::vector<simb::MCTruth> > mclistHandle = type[mcl];
206 
207  for(size_t m = 0; m < mclistHandle->size(); ++m)
208  {
209  art::Ptr<simb::MCTruth> mct(mclistHandle, m);
210 // for(int ipart=0;ipart<mct->NParticles();ipart++)
211 // {
212 // int pdg=mct->GetParticle(ipart).PdgCode();
213 // double xx=mct->GetParticle(ipart).Vx();
214 // double yy=mct->GetParticle(ipart).Vy();
215 // double zz=mct->GetParticle(ipart).Vz();
216 
217  event_type=mct->GetParticle(0).PdgCode();
218  vertex_x=mct->GetParticle(0).Vx();
219  vertex_y=mct->GetParticle(0).Vy();
220  vertex_z=mct->GetParticle(0).Vz();
221 
222  if (event_type==12||event_type==-12||event_type==14||event_type==-14||event_type==16||event_type==-16)
223  {
224  is_Neutrino=1;
225  Neutrino_Interaction=mct->GetNeutrino().InteractionType();
226  }
227  else
228  {
229  is_Neutrino=0;
230  Neutrino_Interaction=-9999;
231  }
232 
233 // }
234  }
235 
236 }
237 
238 
239 ////////////////////////////////// Putting at 0 all the variables//////////////////////////////
240 
241 for (int g=0; g<MaxPhotons; g++)
242 {
243  for (int u=0; u<360; u++)
244  {
245  photon_time[u][g]=0;
246  }
247 }
248 
252 
254 
255 ////////////////////////////////// Charge part: identify the baricentre of the event //////////////////////////////
256 
257 for (std::size_t chargechannel = 0; chargechannel<charge.size(); ++chargechannel) //loop on SimChannel
258 {
259  auto const& channeltdcide = charge.at(chargechannel).TDCIDEMap();
260 
261  for (std::size_t TDCnu = 0; TDCnu<channeltdcide.size(); ++TDCnu) //loop on TDC
262  {
263 
264  sim::TDCIDE const& tdcide = channeltdcide.at(TDCnu);
265 
266  for (std::size_t IDEnu = 0; IDEnu<tdcide.second.size(); ++IDEnu) //loop on IDE
267  {
268  sim::IDE const& ida = tdcide.second.at(IDEnu);
269 
270 // std::cout << "IDA " << ida.x << '\t' << ida.y << '\t' << ida.z << std::endl;
271 
276 
277  } //loop on IDE
278 
279  } //loop on TDC
280 
281 }//loop on SimChannel
282 
286 
288 
289 ////////////////////////////////// Light part //////////////////////////////////////////////////
290 turned_PMT=0;
291 
294 
296 
297 for (std::size_t channel = 0; channel < optical.size(); ++channel) {
298 
299  sim::SimPhotons const& photon_vec = optical[channel];
300 
301  noPMT[channel] = channel;
302 
303  photons_collected[channel]= photon_vec.size();
304 
305 // double media = photons_collected[channel]*QE;
306 
307 // QE_photons_collected[channel]= Ran.Poisson(media);
308 
309  QE_photons_collected[channel]= 0.06*photons_collected[channel];
310 
311  if (photons_collected[channel]>0){
312 
313  turned_PMT++;
314  }
315 
316  double xyz[3];
317 
318  geom->OpDetGeoFromOpChannel(channel).GetCenter(xyz);
319 
320  PMTx[channel] = xyz[0];
321  PMTy[channel] = xyz[1];
322  PMTz[channel] = xyz[2];
323 
325  reco_barycentre_z = reco_barycentre_z + PMTz[channel]*photons_collected[channel];
326  total_coll_photons= total_coll_photons + photons_collected[channel];
327 
328  firstphoton_time[channel] = 100000000;
329 
330  if (photons_collected[channel]>0)
331  {
332  for (size_t i = 0; i<photon_vec.size() && int(i)< MaxPhotons; ++i)
333  {
334  photon_time[channel][i]= photon_vec.at(i).Time;
335 
336  if (photon_time[channel][i]<firstphoton_time[channel])
337  {
338  firstphoton_time[channel]=photon_time[channel][i];
339  }
340  }
341 
342  }
343 
344 
345 // std::cout << PMTx[channel] << '\t' << PMTy[channel] << '\t' << PMTz[channel] << std::endl;
346 
347  if (PMTx[channel]<0){Cryostat[channel]=0;}
348  if (PMTx[channel]>0){Cryostat[channel]=1;}
349 
350  if (PMTx[channel]<-200){TPC[channel]=0;}
351  if (PMTx[channel]>-200 && PMTx[channel]<0){TPC[channel]=1;}
352  if (PMTx[channel]<200 && PMTx[channel]>0){TPC[channel]=2;}
353  if (PMTx[channel]>200){TPC[channel]=3;}
354 
355 }
356 
357 //total_coll_photons = total_coll_photons;
358 
359 //std::cout << " fotoni finale = " <<total_coll_photons <<std::endl;
360 
363 
364 
368 
369 // optical hit part
370 
371 /*for (int u=0; u<360; u++)
372 {
373 hit_peaktime[u]=-1;
374 hit_width[u]=-1;
375 hit_area[u]=-1;
376 hit_peak[u]=-1;
377 hit_phe[u]=-1;
378 }*/
379 
380 nHit = hit.size();
381 
382 std::cout << "Qua arriva prima del for" << std::endl;
383 
384 for (std::size_t hit_n = 0; hit_n < hit.size(); ++hit_n) {
385 
386  recob::OpHit const& hit_vec = hit[hit_n];
387 
388 
389  std::cout << "apre il vettore numer = " << hit_n << std::endl;
390 
391 
392  noPMT[hit_n] = hit_vec.OpChannel();
393 
394  std::cout << "del canale numer = " << noPMT[hit_n] << std::endl;
395 
396  //int ifhit= noPMT[hit_n];
397 
398  hit_peaktime[hit_n] = hit_vec.PeakTime();
399  hit_width[hit_n] = hit_vec.Width();
400  hit_area[hit_n] = hit_vec.Area();
401  hit_peak[hit_n] = hit_vec.Amplitude();
402  hit_phe[hit_n] = hit_vec.PE();
403 
404  std::cout << "di area uguale a = " << hit_area[hit_n] << std::endl;
405 
406 }
407 
408 fTree->Fill();
409 }
float z
z position of ionization [cm]
Definition: SimChannel.h:121
unsigned int event
Definition: DataStructs.h:634
art::InputTag hitLabel
double PMTx[nPMTs]
std::pair< unsigned short, std::vector< sim::IDE > > TDCIDE
List of energy deposits at the same time (on this channel)
Definition: SimChannel.h:127
double hit_phe[nPMTs]
float photon_time[nPMTs][MaxPhotons]
float photons_collected[nPMTs]
art::InputTag photonLabel
double PMTy[nPMTs]
double PeakTime() const
Definition: OpHit.h:88
process_name hit
Definition: cheaterreco.fcl:51
double hit_peaktime[nPMTs]
BEGIN_PROLOG g
float x
x position of ionization [cm]
Definition: SimChannel.h:119
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
double hit_peak[nPMTs]
double Width() const
Definition: OpHit.h:92
double PMTz[nPMTs]
Ionization at a point of the TPC sensitive volume.
Definition: SimChannel.h:86
float energy
energy deposited by ionization by this track ID and time [MeV]
Definition: SimChannel.h:118
double Amplitude() const
Definition: OpHit.h:94
float QE_photons_collected[nPMTs]
double PE() const
Definition: OpHit.h:95
float y
y position of ionization [cm]
Definition: SimChannel.h:120
double hit_area[nPMTs]
Collection of photons which recorded on one channel.
Definition: SimPhotons.h:136
art::InputTag chargeLabel
const int MaxPhotons
double Area() const
Definition: OpHit.h:93
double hit_width[nPMTs]
TCEvent evt
Definition: DataStructs.cxx:8
int OpChannel() const
Definition: OpHit.h:86
float firstphoton_time[nPMTs]
BEGIN_PROLOG could also be cout
void icarus::TrigInfo::beginJob ( )
override

Definition at line 411 of file TrigInfo_module.cc.

412 {
413 
414 art::ServiceHandle<art::TFileService> tfs;
415 fTree = tfs->make<TTree>("lighttree","tree for the light response");
416 
417 fTree->Branch("event",&event,"event/I");
418 fTree->Branch("event_type",&event_type,"event_type/I");
419 fTree->Branch("is_Neutrino",&is_Neutrino,"is_Neutrino/I");
420 fTree->Branch("Neutrino_Interaction",&Neutrino_Interaction,"Neutrino_Interaction/I");
421 fTree->Branch("total_quenched_energy",&total_quenched_energy,"total_quenched_energy");
422 fTree->Branch("Cryostat",Cryostat,("Cryostat[" + std::to_string(nPMTs) + "]/I").c_str());
423 fTree->Branch("TPC",TPC,("TPC[" + std::to_string(nPMTs) + "]/I").c_str());
424 fTree->Branch("noPMT",noPMT,("noPMT[" + std::to_string(nPMTs) + "]/I").c_str());
425 fTree->Branch("PMTx",PMTx,("PMTx[" + std::to_string(nPMTs) + "]/D").c_str());
426 fTree->Branch("PMTy",PMTy,("PMTy[" + std::to_string(nPMTs) + "]/D").c_str());
427 fTree->Branch("PMTz",PMTz,("PMTz[" + std::to_string(nPMTs) + "]/D").c_str());
428 fTree->Branch("turned_PMT",&turned_PMT,"turned_PMT/I");
429 fTree->Branch("total_coll_photons",&total_coll_photons,"total_coll_photons/I");
430 fTree->Branch("photons_colleted",photons_collected,("photons_collected[" + std::to_string(nPMTs) + "]/F").c_str());
431 fTree->Branch("QE_photons_colleted",QE_photons_collected,("QE_photons_collected[" + std::to_string(nPMTs) + "]/F").c_str());
432 fTree->Branch("firstphoton_time",firstphoton_time,("firstphoton_time[" + std::to_string(nPMTs) + "]/F").c_str());
433 //fTree->Branch("photon_time",&photon_time,"photon_time[360][10000]/F");
434 
435 fTree->Branch("nHit",&nHit,"nHit/I");
436 fTree->Branch("hit_peaktime",hit_peaktime,("hit_peaktime[" + std::to_string(nPMTs) + "]/D").c_str());
437 fTree->Branch("hit_width",hit_width,("hit_width[" + std::to_string(nPMTs) + "]/D").c_str());
438 fTree->Branch("hit_area",hit_area,("hit_area[" + std::to_string(nPMTs) + "]/D").c_str());
439 fTree->Branch("hit_peak",hit_peak,("hit_peak[" + std::to_string(nPMTs) + "]/D").c_str());
440 fTree->Branch("hit_phe",hit_phe,("hit_phe[" + std::to_string(nPMTs) + "]/D").c_str());
441 
442 fTree->Branch("vertex_x",&vertex_x,"vertex_x/D");
443 fTree->Branch("vertex_y",&vertex_y,"vertex_y/D");
444 fTree->Branch("vertex_z",&vertex_z,"vertex_z/D");
445 fTree->Branch("true_barycentre_x",&true_barycentre_x,"true_barycentre_x/F");
446 fTree->Branch("true_barycentre_y",&true_barycentre_y,"true_barycentre_y/F");
447 fTree->Branch("true_barycentre_z",&true_barycentre_z,"true_barycentre_z/F");
448 fTree->Branch("reco_barycentre_y",&reco_barycentre_y,"reco_barycentre_y/F");
449 fTree->Branch("reco_barycentre_z",&reco_barycentre_z,"reco_barycentre_z/F");
450 fTree->Branch("PMT_error_y",&PMT_error_y,"PMT_error_y/F");
451 fTree->Branch("PMT_error_z",&PMT_error_z,"PMT_error_z/F");
452 fTree->Branch("PMT_total_error",&PMT_total_error,"PMT_total_error/F");
453 }
double PMTx[nPMTs]
double hit_phe[nPMTs]
float photons_collected[nPMTs]
double PMTy[nPMTs]
double hit_peaktime[nPMTs]
double hit_peak[nPMTs]
double PMTz[nPMTs]
float QE_photons_collected[nPMTs]
double hit_area[nPMTs]
std::string to_string(WindowPattern const &pattern)
double hit_width[nPMTs]
art::ServiceHandle< art::TFileService > tfs
const int nPMTs
float firstphoton_time[nPMTs]
TrigInfo& icarus::TrigInfo::operator= ( TrigInfo const &  )
delete
TrigInfo& icarus::TrigInfo::operator= ( TrigInfo &&  )
delete

Member Data Documentation

art::InputTag icarus::TrigInfo::chargeLabel
private

Definition at line 163 of file TrigInfo_module.cc.

int icarus::TrigInfo::Cryostat[nPMTs]
private

Definition at line 128 of file TrigInfo_module.cc.

int icarus::TrigInfo::event
private

Definition at line 113 of file TrigInfo_module.cc.

int icarus::TrigInfo::event_type
private

Definition at line 115 of file TrigInfo_module.cc.

float icarus::TrigInfo::firstphoton_time[nPMTs]
private

Definition at line 135 of file TrigInfo_module.cc.

TTree* icarus::TrigInfo::fTree
private

Definition at line 109 of file TrigInfo_module.cc.

double icarus::TrigInfo::hit_area[nPMTs]
private

Definition at line 140 of file TrigInfo_module.cc.

double icarus::TrigInfo::hit_peak[nPMTs]
private

Definition at line 141 of file TrigInfo_module.cc.

double icarus::TrigInfo::hit_peaktime[nPMTs]
private

Definition at line 138 of file TrigInfo_module.cc.

double icarus::TrigInfo::hit_phe[nPMTs]
private

Definition at line 142 of file TrigInfo_module.cc.

double icarus::TrigInfo::hit_width[nPMTs]
private

Definition at line 139 of file TrigInfo_module.cc.

art::InputTag icarus::TrigInfo::hitLabel
private

Definition at line 165 of file TrigInfo_module.cc.

int icarus::TrigInfo::is_Neutrino
private

Definition at line 117 of file TrigInfo_module.cc.

int icarus::TrigInfo::Neutrino_Interaction
private

Definition at line 118 of file TrigInfo_module.cc.

int icarus::TrigInfo::nHit
private

Definition at line 137 of file TrigInfo_module.cc.

int icarus::TrigInfo::noPMT[nPMTs]
private

Definition at line 120 of file TrigInfo_module.cc.

float icarus::TrigInfo::photon_time[nPMTs][MaxPhotons]
private

Definition at line 133 of file TrigInfo_module.cc.

art::InputTag icarus::TrigInfo::photonLabel
private

Definition at line 162 of file TrigInfo_module.cc.

float icarus::TrigInfo::photons_collected[nPMTs]
private

Definition at line 131 of file TrigInfo_module.cc.

float icarus::TrigInfo::PMT_error_y
private

Definition at line 158 of file TrigInfo_module.cc.

float icarus::TrigInfo::PMT_error_z
private

Definition at line 159 of file TrigInfo_module.cc.

float icarus::TrigInfo::PMT_total_error
private

Definition at line 160 of file TrigInfo_module.cc.

double icarus::TrigInfo::PMTx[nPMTs]
private

Definition at line 124 of file TrigInfo_module.cc.

double icarus::TrigInfo::PMTy[nPMTs]
private

Definition at line 125 of file TrigInfo_module.cc.

double icarus::TrigInfo::PMTz[nPMTs]
private

Definition at line 126 of file TrigInfo_module.cc.

float icarus::TrigInfo::QE_photons_collected[nPMTs]
private

Definition at line 132 of file TrigInfo_module.cc.

float icarus::TrigInfo::reco_barycentre_y
private

Definition at line 152 of file TrigInfo_module.cc.

float icarus::TrigInfo::reco_barycentre_z
private

Definition at line 153 of file TrigInfo_module.cc.

float icarus::TrigInfo::total_coll_photons
private

Definition at line 156 of file TrigInfo_module.cc.

float icarus::TrigInfo::total_quenched_energy
private

Definition at line 155 of file TrigInfo_module.cc.

int icarus::TrigInfo::TPC[nPMTs]
private

Definition at line 129 of file TrigInfo_module.cc.

float icarus::TrigInfo::true_barycentre_x
private

Definition at line 144 of file TrigInfo_module.cc.

float icarus::TrigInfo::true_barycentre_y
private

Definition at line 145 of file TrigInfo_module.cc.

float icarus::TrigInfo::true_barycentre_z
private

Definition at line 146 of file TrigInfo_module.cc.

int icarus::TrigInfo::turned_PMT
private

Definition at line 122 of file TrigInfo_module.cc.

art::InputTag icarus::TrigInfo::typoLabel
private

Definition at line 164 of file TrigInfo_module.cc.

double icarus::TrigInfo::vertex_x
private

Definition at line 148 of file TrigInfo_module.cc.

double icarus::TrigInfo::vertex_y
private

Definition at line 149 of file TrigInfo_module.cc.

double icarus::TrigInfo::vertex_z
private

Definition at line 150 of file TrigInfo_module.cc.


The documentation for this class was generated from the following file: