385 fEvent =
event.id().event();
398 std::map< int, const simb::MCParticle* > particleMap;
401 for (
auto const& particle : (*particleHandle) )
411 fPDG = particle.PdgCode();
420 size_t numberTrajectoryPoints = particle.NumberTrajectoryPoints();
424 int last = numberTrajectoryPoints - 1;
425 const TLorentzVector& positionStart = particle.Position(0);
426 const TLorentzVector& positionEnd = particle.Position(last);
427 const TLorentzVector& momentumStart = particle.Momentum(0);
428 const TLorentzVector& momentumEnd = particle.Momentum(last);
432 double x_increment = 0.;
433 double z_increment = 0.;
435 TVector3 trackStart(positionStart.X()+x_increment,positionStart.Y(),positionStart.Z()+z_increment);
451 momentumEnd.GetXYZT(
fEndPE );
469 double trackLength = ( positionEnd - positionStart ).Rho();
481 unsigned int counters_hit = 0;
482 std::vector< std::vector<double> > hitcounters;
485 trackStart, momentumStart.Vect(),
488 if(counters_hit != hitcounters.size()){
490 outfile <<
"ERROR: size of hit counters vector is not the same as number of hit counters." 496 bool Layer_1_2 =
false;
497 bool Layer_3_4_5 =
false;
498 bool Layer_E =
false;
499 bool Layer_W =
false;
500 bool Layer_N_U =
false;
501 bool Layer_N_L =
false;
502 bool Layer_S_U =
false;
503 bool Layer_S_L =
false;
508 for(
unsigned int hc=0; hc<hitcounters.size(); hc++){
512 outfile <<
"Hit counter ID " << hitcounters[hc][0] <<
", flag " 513 << hitcounters[hc][1] <<
", track ID " << hitcounters[hc][2]
514 <<
", intersection point: ";
517 for(
unsigned int nd=3; nd<hitcounters[hc].size(); nd++){
519 outfile << hitcounters[hc][nd] <<
" ";
526 if( 40 <= hitcounters[hc][0] && hitcounters[hc][0] <= 61){
529 if( hitcounters[hc][0] > 61){
532 if (14 <= hitcounters[hc][0] && hitcounters[hc][0] <=19){
535 if ( 34 <= hitcounters[hc][0] && hitcounters[hc][0] <= 39){
538 if (8 <= hitcounters[hc][0] && hitcounters[hc][0] <= 13){
541 if (28 <= hitcounters[hc][0] && hitcounters[hc][0] <= 33){
544 if (hitcounters[hc][0] <= 7){
547 if (20 <= hitcounters[hc][0] && hitcounters[hc][0] <= 27){
553 if (Layer_1_2 && Layer_3_4_5){
556 if (Layer_N_U && Layer_S_L){
559 if (Layer_N_L && Layer_S_U){
562 if (Layer_E && Layer_W){
583 for (
auto const&
channel : (*simChannelHandle) )
595 auto const& timeSlices =
channel.TDCIDEMap();
598 for (
auto const& timeSlice : timeSlices )
608 auto const& energyDeposits = timeSlice.second;
613 for (
auto const& energyDeposit : energyDeposits )
620 if ( energyDeposit.trackID !=
fTrackID ){
646 std::vector< art::Ptr<raw::RawDigit> > Digits;
650 for(
size_t d = 0;
d < Digits.size();
d++){
669 std::vector<short> uncompressed(digit->
Samples());
698 for(
unsigned int l=0;
l<uncompressed.size();
l++) {
700 if(uncompressed.at(
l)!=0){
TH1D * hit_counter_occupancy
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
std::vector< TH1I * > fChanZ1
art::ServiceHandle< geo::Geometry > fGeom
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
std::string fRawDigitLabel
ChannelID_t Channel() const
DAQ channel this raw data was read from.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
Planes which measure Z direction.
std::string fSimulationProducerLabel
geo::MuonCounter35Alg * muon_counter
std::vector< TH1I * > fChanU
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
Detector simulation of raw signals on wires.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
static int testTrackInAllCounters(int trackID, TVector3 trackpoint, TVector3 trackvector, std::vector< std::vector< double > > &geometry, std::vector< std::vector< double > > &hitcounters)
unsigned int fChansPerAPA
std::vector< std::vector< double > > countergeometry
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
std::vector< TH1I * > fChanV
TTree * fSimulationNtuple
QTextStream & endl(QTextStream &s)
std::vector< TH1I * > fChanZ0