Public Member Functions | Private Attributes | List of all members
sim::GenericCRTUtility Class Reference

#include <GenericCRT.h>

Public Member Functions

sim::AuxDetIDE toAuxDetIDE (sim::AuxDetHit const &InputHit) const
 
std::vector< unsigned int > GetAuxDetChannels (const std::vector< sim::AuxDetHit > &InputHitVector) const
 
std::vector< sim::AuxDetSimChannelGetAuxDetSimChannels (const std::vector< sim::AuxDetHit > &InputHitVector) const
 
sim::AuxDetSimChannel GetAuxDetSimChannelByNumber (const std::vector< sim::AuxDetHit > &InputHitVector, unsigned int inputchannel) const
 

Private Attributes

art::ServiceHandle< geo::Geometry const > fGeo
 

Detailed Description

Definition at line 26 of file GenericCRT.h.

Member Function Documentation

std::vector< unsigned int > sim::GenericCRTUtility::GetAuxDetChannels ( const std::vector< sim::AuxDetHit > &  InputHitVector) const

Definition at line 41 of file GenericCRT.cxx.

42 {
43 
44  std::vector<unsigned int> AuxDetChanNumber;
45  AuxDetChanNumber.reserve(size(InputHitVector));
46 
47 
48  for(auto const& hit : InputHitVector)
49  {
50 
52  = std::find(AuxDetChanNumber.begin(), AuxDetChanNumber.end(), hit.GetID());
53 
54  if(Chanitr == AuxDetChanNumber.end()){ //If trackID is already in the map, update it
55  //if channel ID is not in the set yet, add it
56  AuxDetChanNumber.push_back(hit.GetID());
57  }//
58 
59  }
60 
61 return AuxDetChanNumber;
62 
63 }
intermediate_table::iterator iterator
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
Detector simulation of raw signals on wires.
sim::AuxDetSimChannel sim::GenericCRTUtility::GetAuxDetSimChannelByNumber ( const std::vector< sim::AuxDetHit > &  InputHitVector,
unsigned int  inputchannel 
) const

Definition at line 67 of file GenericCRT.cxx.

68 {
69  std::vector<sim::AuxDetIDE> IDEvector;
70  //loop over sim::AuxDetHits and assign them to AuxDetSimChannels.
71 
72  size_t ad_id_no = 9999;
73  size_t ad_sen_id_no = 9999;
74 
75  for (auto const& auxDetHit : InputHitVector)
76  {
77 
78  double xcoordinate = (auxDetHit.GetEntryX() + auxDetHit.GetExitX())/2.0;
79  double ycoordinate = (auxDetHit.GetEntryY() + auxDetHit.GetExitY())/2.0;
80  double zcoordinate = (auxDetHit.GetEntryZ() + auxDetHit.GetExitZ())/2.0;
81  double worldPos[3] = {xcoordinate,ycoordinate,zcoordinate};
82  fGeo->FindAuxDetSensitiveAtPosition(worldPos, ad_id_no, ad_sen_id_no, 0.0001);
83  if(auxDetHit.GetID() == inputchannel) // this is the channel we want.
84  {
85  auto tempIDE = toAuxDetIDE(auxDetHit);
86 
88  = std::find(IDEvector.begin(), IDEvector.end(), tempIDE);
89 
90  if(IDEitr != IDEvector.end()){ //If trackID is already in the map, update it
91  //Andrzej's note - following logic from AuxDetReadout in Legacy, but why are the other paremeters getting overwritten like that?
92  IDEitr->energyDeposited += tempIDE.energyDeposited;
93  IDEitr->exitX = tempIDE.exitX;
94  IDEitr->exitY = tempIDE.exitY;
95  IDEitr->exitZ = tempIDE.exitZ;
96  IDEitr->exitT = tempIDE.exitT;
97  IDEitr->exitMomentumX = tempIDE.exitMomentumX;
98  IDEitr->exitMomentumY = tempIDE.exitMomentumY;
99  IDEitr->exitMomentumZ = tempIDE.exitMomentumZ;
100  }
101  else{ //if trackID is not in the set yet, add it
102  IDEvector.push_back(std::move(tempIDE));
103  }//else
104 
105  break;
106  } // end if the AuxDetHit channel checks out.
107 
108  } // end main loop on AuxDetHit
109 
110  //push back the AuxDetSimChannel Vector.
111  //TODO check the last parameter values.
112  return sim::AuxDetSimChannel(ad_id_no, std::move(IDEvector), ad_sen_id_no);
113 }
void FindAuxDetSensitiveAtPosition(geo::Point_t const &point, std::size_t &adg, std::size_t &sv, double tolerance=0) const
Fills the indices of the sensitive auxiliary detector at location.
intermediate_table::iterator iterator
sim::AuxDetIDE toAuxDetIDE(sim::AuxDetHit const &InputHit) const
Definition: GenericCRT.cxx:17
Collection of particles crossing one auxiliary detector cell.
art::ServiceHandle< geo::Geometry const > fGeo
Definition: GenericCRT.h:40
def move(depos, offset)
Definition: depos.py:107
std::vector< sim::AuxDetSimChannel > sim::GenericCRTUtility::GetAuxDetSimChannels ( const std::vector< sim::AuxDetHit > &  InputHitVector) const

Definition at line 118 of file GenericCRT.cxx.

119 {
120  auto const auxDetChannels = GetAuxDetChannels(InputHitVector);
121  std::vector<sim::AuxDetSimChannel> auxDetVector;
122  auxDetVector.reserve(size(auxDetChannels));
123 
124  for (auto const channelNum : auxDetChannels) {
125  auxDetVector.push_back(GetAuxDetSimChannelByNumber(InputHitVector, channelNum));
126  }
127 
128  return auxDetVector;
129 }
sim::AuxDetSimChannel GetAuxDetSimChannelByNumber(const std::vector< sim::AuxDetHit > &InputHitVector, unsigned int inputchannel) const
Definition: GenericCRT.cxx:67
std::vector< unsigned int > GetAuxDetChannels(const std::vector< sim::AuxDetHit > &InputHitVector) const
Definition: GenericCRT.cxx:41
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
sim::AuxDetIDE sim::GenericCRTUtility::toAuxDetIDE ( sim::AuxDetHit const &  InputHit) const

Title: GenericCRT Utility Class Author: Andrzej Szelc (andrz.nosp@m.ejs@.nosp@m.fnal..nosp@m.gov)

Description: Class with Algorithms to convert sim::AuxDetHits to sim::AuxDetSimChannels

Definition at line 17 of file GenericCRT.cxx.

18  {
19  sim::AuxDetIDE outputIDE;
20 
21  outputIDE.trackID = InputHit.GetTrackID();
22  outputIDE.energyDeposited = InputHit.GetEnergyDeposited();
23  outputIDE.entryX = InputHit.GetEntryX();
24  outputIDE.entryY = InputHit.GetEntryY();
25  outputIDE.entryZ = InputHit.GetEntryZ();
26  outputIDE.entryT = InputHit.GetEntryT();
27  outputIDE.exitX = InputHit.GetExitX();
28  outputIDE.exitY = InputHit.GetExitY();
29  outputIDE.exitZ = InputHit.GetExitZ();
30  outputIDE.exitT = InputHit.GetExitT();
31  outputIDE.exitMomentumX = InputHit.GetExitMomentumX();
32  outputIDE.exitMomentumY = InputHit.GetExitMomentumY();
33  outputIDE.exitMomentumZ = InputHit.GetExitMomentumZ();
34 
35 
36  return outputIDE;
37 }
int trackID
Geant4 supplied track ID.
float exitMomentumZ
Exit Z-Momentum of particle.
float exitY
Exit position Y of particle.
float entryT
Entry time of particle.
float exitMomentumX
Exit X-Momentum of particle.
float exitT
Exit time of particle.
float exitZ
Exit position Z of particle.
float entryZ
Entry position Z of particle.
float exitX
Exit position X of particle.
float energyDeposited
total energy deposited for this track ID and time
float entryX
Entry position X of particle.
float entryY
Entry position Y of particle.
MC truth information to make RawDigits and do back tracking.
float exitMomentumY
Exit Y-Momentum of particle.

Member Data Documentation

art::ServiceHandle<geo::Geometry const> sim::GenericCRTUtility::fGeo
private

Definition at line 40 of file GenericCRT.h.


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