195 art::ServiceHandle<geo::Geometry> geom;
197 std::vector<sim::SimPhotons>
const& optical = *(
evt.getValidHandle<std::vector<sim::SimPhotons>>(
photonLabel));
198 std::vector<sim::SimChannel>
const& charge = *(
evt.getValidHandle<std::vector<sim::SimChannel>>(
chargeLabel));
207 auto type =
evt.getMany< std::vector<simb::MCTruth> >();
208 art::Handle< std::vector<simb::MCParticle> > particleVecHandle;
209 evt.getByLabel(
"largeant", particleVecHandle);
211 std::vector<const simb::MCParticle*> particleVec;
212 if (particleVecHandle.isValid())
214 for(
size_t idx = 0; idx < particleVecHandle->size(); idx++) particleVec.push_back(&particleVecHandle->at(idx));
216 art::Handle< std::vector<recob::Track> > trackVecHandle;
217 evt.getByLabel(
"pandoraTrackICARUSCryo0", trackVecHandle);
219 std::vector<const recob::Track*> trackVec;
220 if (trackVecHandle.isValid())
222 for(
size_t idx = 0; idx < trackVecHandle->size(); idx++) trackVec.push_back(&trackVecHandle->at(idx));
230 for (
int u=0; u<360; u++)
244 for (std::size_t chargechannel = 0; chargechannel<charge.size(); ++chargechannel)
246 auto const& channeltdcide = charge.at(chargechannel).TDCIDEMap();
248 for (std::size_t TDCnu = 0; TDCnu<channeltdcide.size(); ++TDCnu)
251 sim::TDCIDE const& tdcide = channeltdcide.at(TDCnu);
253 for (std::size_t IDEnu = 0; IDEnu<tdcide.second.size(); ++IDEnu)
255 sim::IDE const& ida = tdcide.second.at(IDEnu);
281 for (std::size_t channel = 0; channel < optical.size(); ++channel) {
285 noPMT[channel] = channel;
302 geom->OpDetGeoFromOpChannel(channel).GetCenter(xyz);
304 PMTx[channel] = xyz[0];
305 PMTy[channel] = xyz[1];
306 PMTz[channel] = xyz[2];
312 if (photons_collected[channel]>0)
314 for (
size_t i = 0; i<photon_vec.size() && int(i)<
MaxPhotons; ++i)
332 if (
PMTx[channel]<-200){
TPC[channel]=0;}
333 if (
PMTx[channel]>-200 &&
PMTx[channel]<0){
TPC[channel]=1;}
334 if (
PMTx[channel]<200 &&
PMTx[channel]>0){
TPC[channel]=2;}
335 if (
PMTx[channel]>200){
TPC[channel]=3;}
345 for(
int ijk=0;ijk<360;ijk++)
373 for(
size_t mcl = 0; mcl <
type.size(); ++mcl)
375 art::Handle< std::vector<simb::MCTruth> > mclistHandle =
type[mcl];
377 for(
size_t m = 0;
m < mclistHandle->size(); ++
m)
379 art::Ptr<simb::MCTruth> mct(mclistHandle,
m);
380 for(
int ipart=0;ipart<mct->NParticles();ipart++)
403 for(
const auto& tracknow3 : trackVec)
405 std::cout << tracknow3->NumberTrajectoryPoints() << std::endl;
406 int ntraj = tracknow3->NumberTrajectoryPoints();
407 int last_good_point=ntraj;
408 for (
size_t ijk=0;ijk<tracknow3->NumberTrajectoryPoints();ijk++)
410 auto trajPoint = tracknow3->TrajectoryPoint(ijk);
411 if(trajPoint.position.X()<-600)
421 float y_max_value=-150;
424 for (
size_t ijk=0;ijk<tracknow3->NumberTrajectoryPoints();ijk++)
426 auto trajPoint = tracknow3->TrajectoryPoint(ijk);
427 if(trajPoint.position.Y()>y_max_value)
430 y_max_value=trajPoint.position.Y();
443 auto first_point=tracknow3->TrajectoryPoint(point_y_max);
444 c_f_x=first_point.position.X();
445 c_f_y=first_point.position.Y();
446 c_f_z=first_point.position.Z();
466 std::cout <<
"Start of trajectory at " << first_point.position.X() <<
" " << first_point.position.Y() <<
" " << first_point.position.Z() <<
" cm " << std::endl;
467 for (
int ijk2=0;ijk2<last_good_point;ijk2++)
469 auto trajPoint = tracknow3->TrajectoryPoint(ijk2);
471 float xpr=trajPoint.position.X();
472 float ypr=trajPoint.position.Y();
473 float zpr=trajPoint.position.Z();
474 float distance_from_first_point=sqrt((xpr-c_f_x)*(xpr-c_f_x)+(ypr-c_f_y)*(ypr-c_f_y)+(zpr-c_f_z)*(zpr-c_f_z))/100;
475 float tpr=distance_from_first_point/0.3;
480 for(
int ijk=0;ijk<180;ijk++)
482 float distance_x=xpr-
PMTx[ijk+factor];
483 float distance_y=ypr-
PMTy[ijk+factor];
484 float distance_z=zpr-
PMTz[ijk+factor];
485 float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
486 float time_travel_light=total_distance/(0.1);
513 for(
const auto& particlenow3 : particleVec)
516 for ( simb::MCTrajectory::const_iterator trajectory = particlenow3->Trajectory().begin(); trajectory != particlenow3->Trajectory().end(); ++trajectory)
518 float xp=(*trajectory).first.X();
519 float yp=(*trajectory).first.Y();
520 float zp=(*trajectory).first.Z();
521 float tp=(*trajectory).first.T();
524 if (yp>-185 && yp<140 && fabs(zp)<910)
526 if (xp<-343 || xp>-247) {
529 if (xp<-193 || xp>-98) {
534 if(yp>-185 && yp<140 && fabs(zp)<910 && fabs(xp)<370 && fabs(xp)>70){
535 for(
int ijk=0;ijk<180;ijk++)
537 float distance_x=xp-
PMTx[ijk+factor];
538 float distance_y=yp-
PMTy[ijk+factor];
539 float distance_z=zp-
PMTz[ijk+factor];
540 float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
541 float time_travel_light_v2=total_distance/(0.2);
542 float time_travel_light=total_distance/(0.1);
543 float time_travel_light_v3=total_distance/(0.05);
570 for(
int ijk=0;ijk<180;ijk++)
572 float distance_x=(xp-25)-PMTx[ijk+factor];
573 float distance_y=yp-PMTy[ijk+factor];
574 float distance_z=zp-PMTz[ijk+factor];
575 float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
576 float time_travel_light_d2=total_distance/(0.1);
579 for(
int ijk=0;ijk<180;ijk++)
581 float distance_x=(xp+25)-PMTx[ijk+factor];
582 float distance_y=yp-PMTy[ijk+factor];
583 float distance_z=zp-PMTz[ijk+factor];
584 float total_distance=sqrt(distance_x*distance_x+distance_y*distance_y+distance_z*distance_z)/100;
585 float time_travel_light_d3=total_distance/(0.1);
float firstphoton_zp_expected[nPMTs]
float firstphoton_yp_expected_v3[nPMTs]
float firstphoton_tp_expected[nPMTs]
float z
z position of ionization [cm]
float firstphoton_time_expected_d2[nPMTs]
float firstphoton_xp_expected[nPMTs]
std::pair< unsigned short, std::vector< sim::IDE > > TDCIDE
List of energy deposits at the same time (on this channel)
float photons_collected[nPMTs]
float firstphoton_yp_expected_v2[nPMTs]
float firstphoton_zp_expected_v3[nPMTs]
float firstphoton_time_expected_v3[nPMTs]
float firstphoton_zp_expected_r[nPMTs]
float firstphoton_xp_expected_v2[nPMTs]
float x
x position of ionization [cm]
float firstphoton_tp_expected_r[nPMTs]
float firstphoton_yp_expected[nPMTs]
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
float firstphoton_xp_expected_r[nPMTs]
float firstphoton_tp_expected_v2[nPMTs]
Ionization at a point of the TPC sensitive volume.
float firstphoton_time_expected_d3[nPMTs]
float energy
energy deposited by ionization by this track ID and time [MeV]
float QE_photons_collected[nPMTs]
float firstphoton_yp_expected_r[nPMTs]
float firstphoton_time_expected_r[nPMTs]
float y
y position of ionization [cm]
Collection of photons which recorded on one channel.
float firstphoton_time_expected[nPMTs]
float firstphoton_xp_expected_v3[nPMTs]
float firstphoton_tp_expected_v3[nPMTs]
float firstphoton_zp_expected_v2[nPMTs]
float firstphoton_time[nPMTs]
float firstphoton_time_expected_v2[nPMTs]
float photon_time[nPMTs][MaxPhotons]
BEGIN_PROLOG could also be cout
float total_quenched_energy
art::InputTag chargeLabel
art::InputTag photonLabel