187 art::ServiceHandle<cheat::ParticleInventoryService const> pi_serv;
188 const sim::ParticleList& plist = pi_serv->ParticleList();
189 art::ServiceHandle<geo::Geometry const> geom;
193 std::vector<const sim::SimChannel*> sccol;
196 double totalCharge=0.0;
197 double totalEnergy=0.0;
199 for(
size_t sc = 0; sc < sccol.size(); ++sc){
203 const auto & tdcidemap = sccol[sc]->TDCIDEMap();
204 for(
auto mapitr = tdcidemap.begin(); mapitr != tdcidemap.end(); mapitr++){
205 const std::vector<sim::IDE> idevec = (*mapitr).second;
206 numIDEs += idevec.size();
207 for(
size_t iv = 0; iv < idevec.size(); ++iv){
208 if(plist.find( idevec[iv].trackID ) == plist.end()
210 mf::LogWarning(
"LArG4Ana") << idevec[iv].trackID <<
" is not in particle list";
211 totalCharge +=idevec[iv].numElectrons;
212 scCharge += idevec[iv].numElectrons;
213 totalEnergy +=idevec[iv].energy;
214 scEnergy += idevec[iv].energy;
225 const sim::ParticleList& Particles = pi_serv->ParticleList();
226 std::vector<const simb::MCParticle*> pvec;
227 pvec.reserve(Particles.size());
228 for (
const auto& PartPair: Particles) {
229 pvec.push_back(PartPair.second);
230 fPDGCodes->Fill(PartPair.second->PdgCode());
236 for(
unsigned int i = 0; i < pvec.size(); ++i){
237 if(pvec[i]->PdgCode() == 111) pi0loc = i;
238 if(pvec[i]->Mother() == pi0loc+1 &&
240 pvec[i]->PdgCode() == 22){
241 mf::LogInfo(
"LArG4Ana") << pvec[i]->E() <<
" gamma energy ";
246 if (pvec[i]->PdgCode() == 2112 ||
247 pvec[i]->PdgCode() == 3122 ||
248 pvec[i]->PdgCode() == 130 ||
249 pvec[i]->PdgCode() == 310 ||
250 pvec[i]->PdgCode() == 311 ) {
251 fnEnergy->Fill(pvec[i]->
E(),pvec[i]->Weight());
252 fnDist->Fill(pvec[i]->Vx(),pvec[i]->Weight());
255 fTPdg = pvec[i]->PdgCode();
256 fTID = pvec[i]->TrackId();
258 for (
unsigned int s = 0;
s < 35; ++
s){
269 for(
unsigned int s = 0;
s < pvec[i]->Process().length(); ++
s) *(
fTProcess+
s) = pvec[i]->Process()[
s];
271 TVector3 dum = pvec[i]->Position().Vect();
273 for (
unsigned int s = 0;
s < geom->MaterialName(pvec[i]->Position().Vect()).length(); ++
s)
274 *(
fTMaterial+
s) = geom->MaterialName(pvec[i]->Position().Vect())[
s];
276 for (
unsigned int s = 0;
s < geom->VolumeName(pvec[i]->Position().Vect()).length(); ++
s)
277 *(
fTVolume+
s) = geom->VolumeName(pvec[i]->Position().Vect())[
s];
279 for (
unsigned int s = 0;
s < geom->VolumeName(pvec[i]->EndPosition().Vect()).length(); ++
s)
280 *(
fTTVolume+
s) = geom->VolumeName(pvec[i]->EndPosition().Vect())[
s];
289 for(
int d = 0; d <
fTNds; d++ ){
290 daughter = pvec[i]->Daughter(d);
295 for(
unsigned int jj = i; jj < pvec.size(); ++jj){
297 if (
fTDID[d] == pvec[jj]->TrackId()){
298 fTDPdg[d] = pvec[jj]->PdgCode();
299 fTDWt[d] = pvec[jj]->Weight();
301 for (
unsigned int s = 0;
s < pvec[jj]->Process().length(); ++
s)
304 for (
unsigned int kk = 0; kk < 4; ++kk){
305 fT4DOrigin[d*4+kk] = pvec[jj]->Position()[kk];
313 for (
unsigned int ii = 0; ii < 4; ++ii){
325 if(numpi0gamma == 2 && pi0loc > 0){
326 mf::LogInfo(
"LArG4Ana") << pvec[pi0loc]->E();
TProfile * fChannelCharge
Charge per channel.
std::string fG4ModuleLabel
module label for the Geant
TH1D * fnumChannels
The number of channels recieving charge per event.
TH1D * fEventEnergy
Energy collected per event.
TProfile * fChannelEnergy
Energy per channel.
Char_t fTDProcess[200][35]
static const int NoParticleId
TH1D * fEventCharge
Charge collected per event.
then echo File list $list not found else cat $list while read file do echo $file sed s
TProfile * fnumIDEs
Number of drift electrons per channel.