13 #include "art_root_io/TFileService.h" 18 #include "canvas/Persistency/Common/FindOne.h" 19 #include "canvas/Persistency/Common/FindOneP.h" 20 #include "canvas/Persistency/Common/FindMany.h" 21 #include "canvas/Persistency/Common/FindManyP.h" 24 #include "nurandom/RandomUtils/NuRandomService.h" 29 #include "CoreUtils/ServiceUtil.h" 32 #include "CLHEP/Random/RandGauss.h" 33 #include "CLHEP/Random/RandFlat.h" 37 #include "TDatabasePDG.h" 38 #include "TParticlePDG.h" 46 #include <unordered_map> 79 bool isBarrel(
const TVector3& point);
82 bool isEndcap(
const TVector3& point);
109 CLHEP::RandFlat FlatRand(
fEngine);
110 return FlatRand.fire();;
115 CLHEP::RandGauss GausRand(
fEngine);
116 return GausRand.fire(mean, sigma);;
144 std::cout <<
" ==== CAFHelper Parameters ==== " <<
std::endl;
153 std::cout <<
" ==== CAFHelper Parameters ==== " <<
std::endl;
162 bool isInFiducial =
true;
164 float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
180 float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
192 bool isInCalo =
false;
193 float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
207 bool isStopBetween =
false;
208 float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
214 return isStopBetween;
234 float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
235 float theta_point = std::atan(r_point /
std::abs(point.X()) );
237 if( theta_point > theta ) isBarrel =
true;
245 if( !
isBarrel(point) ) isEndcap =
true;
271 void TreatTPCVisible(
const float ecaltime);
272 void TreatTPCNotVisible(
const float ecaltime);
275 void FillCommonVariables(
const int pdg,
const TLorentzVector&
momentum,
const TLorentzVector&
position,
const TLorentzVector& positionEnd,
const int mctrackid,
const int mothertrackid,
const int motherpdg,
const float ptrue,
const float angle,
const std::string mcp_process,
const std::string mcp_endprocess,
const float time);
277 void DoRangeCalculation(
float &preco,
float &angle_reco);
278 void DoGluckSternCalculation(
float &preco,
float &angle_reco);
279 void TPCParticleIdentification();
280 void TreatNeutrons(
const float ecaltime);
281 void TreatPhotons(
const float ecaltime);
282 void TreatOthers(
const float ecaltime);
283 bool CheckVectorSize();
301 const std::vector<int> neutrinos = {12, 14, 16};
303 const std::vector<int> pdg_neutral = {22, 2112, 111, 130, 310, 311, 2114};
305 const std::vector<int> pdg_charged = {211, 13, 2212, 321, 1000010020, 11};
306 const float gastpc_len = 2.;
307 const float gastpc_B = 0.5;
308 const float gastpc_padPitch = 0.1;
309 const float gastpc_X0 = 1300.;
311 const float sigmaP_short = 0.1;
313 const float sigma_x = 0.1;
317 const float NeutronECAL_detEff[2] = {0.2, 0.4};
318 const float sigmaNeutronECAL_first = 0.11;
322 const float ECAL_stock = 0.06;
323 const float ECAL_const = 0.02;
328 const int nLayers = 60;
330 const double ECAL_MIP_Res = 0.23;
332 const double MIP2GeV_factor = 0.814 / 1000;
334 const float fECALTimeResolution = 1.;
335 TParticlePDG *neutron = TDatabasePDG::Instance()->GetParticle(2112);
336 const float neutron_mass = neutron->Mass();
342 std::vector<int> mode, ccnc, ntype, gint,
weight, tgtpdg, gt_t, intert, detected;
343 std::vector<double> q2,
w,
y,
x,
theta,
t, mctime, mcnupx, mcnupy, mcnupz, vertx, verty, vertz;
346 std::vector<int> mctrkid, motherid, pdgmother,
truepdg, _MCPStartX, _MCPStartY, _MCPStartZ, _MCPEndX, _MCPEndY, _MCPEndZ;
348 std::vector<double> trkLen, trkLenPerp, truep, truepx, truepy,
truepz, _angle;
351 std::vector<double>
prob_arr, anglereco, _preco, erecon, etime;
353 std::vector<unsigned int> isFidStart,
isTPCStart, isCaloStart, isInBetweenStart, isThroughCaloStart;
354 std::vector<unsigned int> isFidEnd,
isTPCEnd, isCaloEnd, isInBetweenEnd, isThroughCaloEnd;
355 std::vector<unsigned int> isBarrelStart,
isEndcapStart, isBarrelEnd, isEndcapEnd;
361 fEngine(
art::ServiceHandle<
rndm::NuRandomService>()->createEngine(*this, p,
"Seed"))
363 fGeo = gar::providerFrom<geo::GeometryGAr>();
367 fCorrect4origin = p.
get<
bool>(
"Correct4Origin",
false);
371 consumes<std::vector<simb::MCParticle> >(
fGeantLabel);
381 fRes =
new TF1(
"fRes",
"TMath::Sqrt ( [0]*[0]/x + [1]*[1] )", 3);
382 fRes->FixParameter(0, ECAL_stock);
383 fRes->FixParameter(1, ECAL_const);
387 TString
filename =
"${DUNE_PARDATA_DIR}/MPD/dedxPID/dedxpidmatrices8kevcm.root";
388 TFile pidfile(filename,
"READ");
392 for (
int q = 0; q < 501; ++q)
394 sprintf(str,
"%d", q);
399 m_pidinterp.insert( std::make_pair(q, (TH2F*) pidfile.Get(s.c_str())->Clone(
"pidinterp")) );
405 fTree = tfs->make<TTree>(
"caf",
"caf tree");
408 fTree->Branch(
"Event", &
fEvent);
409 fTree->Branch(
"Run", &
fRun);
410 fTree->Branch(
"SubRun", &
fSubRun);
413 fTree->Branch(
"mode", &
mode);
414 fTree->Branch(
"q2", &
q2);
415 fTree->Branch(
"w", &
w);
416 fTree->Branch(
"y", &
y);
417 fTree->Branch(
"x", &
x);
418 fTree->Branch(
"theta", &
theta);
419 fTree->Branch(
"t", &
t);
420 fTree->Branch(
"ntype", &
ntype);
421 fTree->Branch(
"ccnc", &
ccnc);
422 fTree->Branch(
"gint", &
gint);
423 fTree->Branch(
"tgtpdg", &
tgtpdg);
424 fTree->Branch(
"weight", &
weight);
425 fTree->Branch(
"gt_t", &
gt_t);
426 fTree->Branch(
"intert", &
intert);
427 fTree->Branch(
"mcnupx", &
mcnupx);
428 fTree->Branch(
"mcnupy", &
mcnupy);
429 fTree->Branch(
"mcnupz", &
mcnupz);
430 fTree->Branch(
"vertx", &
vertx);
431 fTree->Branch(
"verty", &
verty);
432 fTree->Branch(
"vertz", &
vertz);
435 fTree->Branch(
"nFSP", &
_nFSP);
437 fTree->Branch(
"detected", &
detected);
439 fTree->Branch(
"MCPTime", &
mctime);
443 fTree->Branch(
"motherid", &
motherid);
444 fTree->Branch(
"mctrkid", &
mctrkid);
445 fTree->Branch(
"truepx", &
truepx);
446 fTree->Branch(
"truepy", &
truepy);
447 fTree->Branch(
"truepz", &
truepz);
448 fTree->Branch(
"MCPEndX", &
_MCPEndX);
449 fTree->Branch(
"MCPEndY", &
_MCPEndY);
450 fTree->Branch(
"MCPEndZ", &
_MCPEndZ);
451 fTree->Branch(
"MCProc", &
_MCProc);
453 fTree->Branch(
"angle", &
_angle);
454 fTree->Branch(
"truep", &
truep);
455 fTree->Branch(
"truepdg", &
truepdg);
457 fTree->Branch(
"recopid", &
recopid);
459 fTree->Branch(
"trkLen", &
trkLen);
461 fTree->Branch(
"preco", &
_preco);
463 fTree->Branch(
"erecon", &
erecon);
464 fTree->Branch(
"etime", &
etime);
465 fTree->Branch(
"prob_arr", &
prob_arr);
475 fTree->Branch(
"isFidEnd", &
isFidEnd);
476 fTree->Branch(
"isTPCEnd", &
isTPCEnd);
550 std::cerr <<
"Event with wrong vector sizes... skipped" <<
std::endl;
561 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
567 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
571 for (
auto const& mct : (*MCTHandle) ) {
572 if (mct.NeutrinoSet()) {
577 w.push_back(nuw.
W());
578 y.push_back(nuw.
Y());
579 x.push_back(nuw.
X());
599 for (
auto const&
gt : (*GTHandle) ) {
613 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
616 std::unordered_map<int, int> TrackIdToIndex;
618 for (
auto const& mcp : (*MCPHandle) ) {
620 TrackIdToIndex[TrackId] = index++;
624 for (
auto const& mcp : (*MCPHandle) ) {
626 const TDatabasePDG* databasePDG = TDatabasePDG::Instance();
627 const TParticlePDG* definition = databasePDG->GetParticle( mcp.
PdgCode() );
628 if (definition ==
nullptr)
continue;
632 const int mctrackid = mcp.
TrackId();
633 const int mothertrackid = mcp.
Mother();
635 const TLorentzVector& position = mcp.
Position(0);
636 const TVector3 spoint(position.X() - fOrigin[0], position.Y() - fOrigin[1], position.Z() - fOrigin[2]);
637 const TLorentzVector& positionEnd = mcp.
EndPosition();
638 const TVector3 epoint(positionEnd.X() - fOrigin[0], positionEnd.Y() - fOrigin[1], positionEnd.Z() - fOrigin[2]);
639 const TLorentzVector& momentum = mcp.
Momentum(0);
640 const TVector3 mom(momentum.X(), momentum.Y(), momentum.Z());
641 const float ptrue = mom.Mag();
642 const float angle = atan(mom.X() / mom.Z());
643 const float time = mcp.
T();
647 if(TrackIdToIndex.find(mothertrackid) != TrackIdToIndex.end()) {
648 motherpdg = (*MCPHandle).at(TrackIdToIndex[mothertrackid]).PdgCode();
652 auto result = std::find(pdg_neutral.begin(), pdg_neutral.end(),
abs(pdg));
653 bool isNeutral = (
result != pdg_neutral.end()) ?
true :
false;
667 FillCommonVariables(pdg, momentum, position, positionEnd, mctrackid, mothertrackid, motherpdg, ptrue, angle, mcp_process, mcp_endprocess, time);
683 void ParamSim::FillCommonVariables(
const int pdg,
const TLorentzVector& momentum,
const TLorentzVector& position,
const TLorentzVector& positionEnd,
const int mctrackid,
const int mothertrackid,
const int motherpdg,
const float ptrue,
const float angle,
const std::string mcp_process,
const std::string mcp_endprocess,
const float time)
685 const TVector3 spoint(position.X() - fOrigin[0], position.Y() - fOrigin[1], position.Z() - fOrigin[2]);
686 const TVector3 epoint(positionEnd.X() - fOrigin[0], positionEnd.Y() - fOrigin[1], positionEnd.Z() - fOrigin[2]);
689 truepx.push_back(momentum.X());
690 truepy.push_back(momentum.Y());
691 truepz.push_back(momentum.Z());
694 _MCPStartX.push_back(position.X() - fOrigin[0]);
695 _MCPStartY.push_back(position.Y() - fOrigin[1]);
696 _MCPStartZ.push_back(position.Z() - fOrigin[2]);
697 _MCPEndX.push_back(positionEnd.X() - fOrigin[0]);
698 _MCPEndY.push_back(positionEnd.Y() - fOrigin[1]);
699 _MCPEndZ.push_back(positionEnd.Z() - fOrigin[2]);
704 _MCPEndX.push_back(positionEnd.X());
705 _MCPEndY.push_back(positionEnd.Y());
706 _MCPEndZ.push_back(positionEnd.Z());
710 truep.push_back(ptrue);
714 _MCProc.push_back(mcp_process);
746 double tracklen = 0.;
747 double tracklen_perp = 0.;
759 TVector3 point(xTraj - fOrigin[0], yTraj - fOrigin[1], zTraj - fOrigin[2]);
770 tracklen += diff.Mag();
771 tracklen_perp += tracklen_perp_vec.Mod();
774 trkLen.push_back(tracklen);
784 float sigma_angle_1 = ((sigma_x * sigma_x * 0.0001) /
trkLen.at(
_nFSP)*
trkLen.at(
_nFSP)*0.0001) * (12*(nHits-1))/(nHits*(nHits+1));
788 float sigma_angle_short = sqrt(sigma_angle_1 + sigma_angle_2);
805 float fracSig_MCS = (0.052*sqrt(1.43)) / (gastpc_B * sqrt(gastpc_X0*
trkLenPerp.at(
_nFSP)*0.0001));
807 float sigmaP =
truep.at(
_nFSP) * sqrt( fracSig_meas*fracSig_meas + fracSig_MCS*fracSig_MCS );
813 float sigma_angle_1 = ((sigma_x * sigma_x * 0.0001) /
trkLen.at(
_nFSP)*
trkLen.at(
_nFSP)*0.0001) * (12*(nHits-1))/(nHits*(nHits+1));
817 float sigma_angle = sqrt(sigma_angle_1 + sigma_angle_2);
829 if ( std::find(pdg_charged.begin(), pdg_charged.end(),
std::abs(pdg)) != pdg_charged.end() )
837 float angle_reco = 0.;
869 TParticlePDG *part = TDatabasePDG::Instance()->GetParticle(
abs(pdg));
873 if( pdg == 1000010020 )
876 float etrue = std::sqrt(ptrue*ptrue + mass*mass) - mass;
877 float ECAL_resolution = fRes->Eval(etrue)*etrue;
879 erecon.push_back((ereco > 0) ? ereco : 0.);
882 etime.push_back(ecaltime);
900 float mass = part->Mass();
901 float etrue = std::sqrt(ptrue*ptrue + mass*mass) - mass;
902 float ECAL_resolution = fRes->Eval(etrue)*etrue;
904 erecon.push_back((ereco > 0) ? ereco : 0.);
906 etime.push_back(ecaltime);
909 if(
abs(pdg) == 11 ){
912 else if(
abs(pdg) == 13 ||
abs(pdg) == 211 )
924 else if(ptrue >= 0.48 && ptrue < 0.75)
929 if(random_number > (1 - 0.8)) {
939 if(random_number > (1 - 0.8)) {
947 else if(ptrue >= 0.75 && ptrue < 0.9)
951 if(random_number > (1 - 0.9)) {
959 if(
abs(pdg) == 211) {
960 if(random_number > (1 - 0.9)) {
972 if(random_number > (1 - 0.95)) {
981 if(random_number > (1 - 0.95)) {
990 else if(
abs(pdg) == 2212 )
1003 double Evis = (double)nLayers;
1008 erecon.push_back((Erec > 0) ? Erec : 0.);
1009 etime.push_back(ecaltime);
1013 if(
abs(pdg) == 13 ||
abs(pdg) == 211 ||
abs(pdg) == 2212 ) {
1025 etime.push_back(-1);
1036 auto found = std::find(pdg_charged.begin(), pdg_charged.end(),
abs(pdg));
1037 if(
found == pdg_charged.end())
1040 etime.push_back(-1);
1046 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1061 for (
int pidm = 0; pidm < 6; ++pidm)
1063 if (
abs(pdg) == pdg_charged.at(pidm) )
1066 std::vector<double> vec;
1067 std::vector<std::string> pnamelist = {
"#pi",
"#mu",
"p",
"K",
"d",
"e"};
1068 std::vector<std::string> recopnamelist = {
"#pi",
"#mu",
"p",
"K",
"d",
"e"};
1071 float dist = 100000000.;
1073 for (
int q = 0; q < 501; ++q)
1076 std::string fulltitle = m_pidinterp[q]->GetTitle();
1077 unsigned first = fulltitle.find(
"=");
1078 unsigned last = fulltitle.find(
"GeV");
1079 std::string substr = fulltitle.substr(first+1, last - first-1);
1080 float pidinterp_mom = std::atof(substr.c_str());
1082 float disttemp =
std::abs(pidinterp_mom - p);
1084 if( disttemp < dist ) {
1091 std::vector< std::pair<float, std::string> > v_prob;
1093 std::string trueparticlename = m_pidinterp[qclosest]->GetXaxis()->GetBinLabel(pidm+1);
1095 if ( trueparticlename == pnamelist[pidm] )
1098 for (
int pidr = 0; pidr < 6; ++pidr)
1100 std::string recoparticlename = m_pidinterp[qclosest]->GetYaxis()->GetBinLabel(pidr+1);
1102 if (recoparticlename == recopnamelist[pidr])
1104 float prob = m_pidinterp[qclosest]->GetBinContent(pidm+1,pidr+1);
1107 v_prob.push_back( std::make_pair(prob, recoparticlename) );
1112 if(v_prob.size() > 1)
1115 std::sort(v_prob.begin(), v_prob.end());
1119 std::partial_sum(v_prob.begin(), v_prob.end(), v_prob.begin(), [](
const std::pair<float, std::string>& _x,
const std::pair<float, std::string>& _y){
return std::pair<float, std::string>(_x.first + _y.first, _y.second);});
1120 for(
size_t ivec = 0; ivec < v_prob.size()-1; ivec++)
1122 if( random_number < v_prob.at(ivec+1).first && random_number >= v_prob.at(ivec).first )
1124 pid = pdg_charged.at(
std::distance( recopnamelist.begin(), std::find(recopnamelist.begin(), recopnamelist.end(), v_prob.at(ivec+1).second) ) );
1130 pid = pdg_charged.at(
std::distance( recopnamelist.begin(), std::find(recopnamelist.begin(), recopnamelist.end(), v_prob.at(0).second) ) );
1148 if(std::find(neutrinos.begin(), neutrinos.end(),
std::abs(pdg)) != neutrinos.end())
1151 etime.push_back(0.);
1157 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1170 etime.push_back(-1);
1174 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1200 int index = (true_KE >= 0.05) ? 1 : 0;
1202 if(random_number > (1 - NeutronECAL_detEff[index]) && true_KE > 0.003)
1208 float eres = sigmaNeutronECAL_first * true_KE;
1210 erecon.push_back(ereco > 0 ? ereco : 0.);
1211 etime.push_back(ecaltime);
1215 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1223 etime.push_back(-1);
1227 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1236 etime.push_back(-1);
1240 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1262 erecon.push_back( (ereco > 0) ? ereco : 0. );
1265 etime.push_back(ecaltime);
1270 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1277 etime.push_back(-1);
1282 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1293 erecon.push_back((ereco > 0) ? ereco : 0.);
1296 etime.push_back(ecaltime);
1301 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1309 etime.push_back(-1);
1314 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1332 etime.push_back(ecaltime);
1334 TParticlePDG *part = TDatabasePDG::Instance()->GetParticle(
abs(pdg));
1337 mass = part->Mass();
1340 float ECAL_resolution = fRes->Eval(etrue)*etrue;
1342 erecon.push_back((ereco > 0) ? ereco : 0.);
1345 if(
abs(pdg) == 11 ){
1348 else if(
abs(pdg) == 13 ||
abs(pdg) == 211 )
1365 if(random_number > (1 - 0.8)) {
1376 if(random_number > (1 - 0.8)) {
1388 if(random_number > (1 - 0.9)) {
1396 if(
abs(pdg) == 211) {
1397 if(random_number > (1 - 0.9)) {
1409 if(random_number > (1 - 0.95)) {
1417 if(
abs(pdg) == 211){
1418 if(random_number > (1 - 0.95)) {
1427 else if(
abs(pdg) == 2212 )
1438 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1444 double Evis = (double)nLayers;
1449 erecon.push_back((Erec > 0) ? Erec : 0.);
1450 etime.push_back(ecaltime);
1454 if(
abs(pdg) == 13 ||
abs(pdg) == 211 ||
abs(pdg) == 2212 ) {
1464 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
1469 etime.push_back(-1);
1475 for (
int pidr = 0; pidr < 6; ++pidr)
prob_arr.push_back(-1);
def analyze(root, level, gtrees, gbranches, doprint)
std::vector< double > _preco
bool PointInFiducial(const TVector3 &point)
void DoGluckSternCalculation(float &preco, float &angle_reco)
void TreatTPCVisible(const float ecaltime)
const TLorentzVector & Position(const int i=0) const
double Z(const size_type i) const
double X(const size_type i) const
CAFHelper(const geo::GeometryCore *fGeo, CLHEP::HepRandomEngine &engine)
std::vector< int > weight
std::vector< double > truepz
double Theta() const
angle between incoming and outgoing leptons, in radians
CLHEP::HepRandomEngine & fEngine
random engine
double Py(const int i=0) const
std::vector< unsigned int > isFidEnd
void TreatPhotons(const float ecaltime)
const TLorentzVector & EndPosition() const
std::vector< double > mcnupy
std::vector< std::string > _MCEndProc
Handle< PROD > getHandle(SelectorBase const &) const
const simb::MCTrajectory & Trajectory() const
std::vector< unsigned int > isBarrelStart
std::vector< int > detected
const simb::MCParticle & Nu() const
double Px(const int i=0) const
std::vector< std::string > _MCProc
std::string fGeneratorLabel
const double fTPCFidRadius
const double MIP2GeV_factor
std::unordered_map< int, TH2F * > m_pidinterp
CLHEP::HepRandomEngine & fEngine
float GaussianSmearing(const float mean, const float sigma)
void ComputeTrkLength(const simb::MCParticle &mcp)
Description of geometry of one entire detector.
bool PointInTPC(const TVector3 &point)
float GetECALOuterEndcapRadius() const
std::vector< int > recopidecal
std::string Process() const
std::vector< double > _angle
std::vector< double > truepx
void DoRangeCalculation(float &preco, float &angle_reco)
ParamSim(fhicl::ParameterSet const &p)
void TreatNeutrons(const float ecaltime)
std::vector< unsigned int > isTPCStart
bool isBarrel(const TVector3 &point)
std::vector< double > vertx
std::string fGeantLabel
module label for geant4 simulated hits
std::vector< int > motherid
std::vector< double > mcnupx
std::vector< double > vertz
std::vector< int > _MCPEndY
void TreatOthers(const float ecaltime)
int InteractionType() const
std::vector< unsigned int > isEndcapEnd
std::vector< int > truepdg
std::vector< double > verty
std::vector< unsigned int > isTPCEnd
double Y(const size_type i) const
#define DEFINE_ART_MODULE(klass)
std::string EndProcess() const
float TPCRadius() const
Returns the radius of the TPC (y or z direction)
std::vector< int > mctrkid
float GetECALInnerEndcapRadius() const
std::vector< unsigned int > isFidStart
T get(std::string const &key) const
bool PointStopBetween(const TVector3 &point)
double T(const int i=0) const
std::vector< int > _MCPEndZ
double fECALEndcapOuterRadius
std::vector< unsigned int > isThroughCaloEnd
const float gastpc_padPitch
SubRunNumber_t subRun() const
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
std::vector< double > truepy
double fECALEndcapInnerRadius
bool isThroughCalo(const TVector3 &point)
std::vector< double > trkLen
float GetECALEndcapStartX() const
void FillCommonVariables(const int pdg, const TLorentzVector &momentum, const TLorentzVector &position, const TLorentzVector &positionEnd, const int mctrackid, const int mothertrackid, const int motherpdg, const float ptrue, const float angle, const std::string mcp_process, const std::string mcp_endprocess, const float time)
float GetECALOuterBarrelRadius() const
bool isEndcap(const TVector3 &point)
std::vector< unsigned int > isEndcapStart
std::vector< double > prob_arr
void TreatMCParticles(art::Event const &e)
std::vector< int > recopid
void SaveGtruthMCtruth(art::Event const &e)
std::vector< unsigned int > isCaloStart
General GArSoft Utilities.
std::vector< unsigned int > isThroughCaloStart
std::vector< unsigned int > isCaloEnd
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
std::vector< int > _MCPStartZ
std::vector< double > truep
std::vector< unsigned int > isBarrelEnd
std::vector< int > _MCPStartY
const TLorentzVector & Momentum(const int i=0) const
std::vector< double > mcnupz
double Pz(const int i=0) const
void TPCParticleIdentification()
std::vector< double > theta
float GetECALInnerBarrelRadius() const
virtual void beginJob() override
EventNumber_t event() const
std::vector< double > mctime
float TPCLength() const
Returns the length of the TPC (x direction)
void analyze(art::Event const &e) override
const geo::GeometryCore * fGeo
pointer to the geometry
std::vector< int > intert
def momentum(x1, x2, x3, scale=1.)
Event generator information.
art framework interface to geometry description
bool PointInCalo(const TVector3 &point)
const double fTPCFidLength
std::vector< double > anglereco
std::vector< int > _MCPEndX
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
std::vector< double > erecon
std::vector< unsigned int > isInBetweenEnd
std::vector< int > tgtpdg
std::vector< unsigned int > isInBetweenStart
void TreatTPCNotVisible(const float ecaltime)
std::vector< int > _MCPStartX
std::vector< int > pdgmother
cet::coded_exception< error, detail::translate > exception
bool hasDecayedInCalo(const TVector3 &point)
QTextStream & endl(QTextStream &s)
double fECALBarrelOuterRadius
QCString & append(const char *s)
float GetECALEndcapOuterX() const
std::vector< double > trkLenPerp
double fECALBarrelInnerRadius
std::vector< double > etime