Public Member Functions | Private Member Functions | Private Attributes | List of all members
gar::CAFHelper Class Reference

Public Member Functions

 CAFHelper (const geo::GeometryCore *fGeo, CLHEP::HepRandomEngine &engine)
 
 ~CAFHelper ()
 
bool PointInFiducial (const TVector3 &point)
 
bool PointInTPC (const TVector3 &point)
 
bool PointInCalo (const TVector3 &point)
 
bool PointStopBetween (const TVector3 &point)
 
bool isThroughCalo (const TVector3 &point)
 
bool hasDecayedInCalo (const TVector3 &point)
 
bool isBarrel (const TVector3 &point)
 
bool isEndcap (const TVector3 &point)
 
float GetRamdomNumber ()
 
float GaussianSmearing (const float mean, const float sigma)
 

Private Member Functions

void PrintParameters ()
 

Private Attributes

CLHEP::HepRandomEngine & fEngine
 
const double fTPCFidRadius = 222.5
 
const double fTPCFidLength = 215.
 
double fTPCRadius
 
double fTPCLength
 
double fECALBarrelInnerRadius
 
double fECALBarrelOuterRadius
 
double fECALEndcapInnerRadius
 
double fECALEndcapOuterRadius
 
double fECALStartX
 
double fECALEndX
 

Detailed Description

Definition at line 51 of file ParamSim_module.cc.

Constructor & Destructor Documentation

gar::CAFHelper::CAFHelper ( const geo::GeometryCore fGeo,
CLHEP::HepRandomEngine &  engine 
)

Definition at line 120 of file ParamSim_module.cc.

121  : fEngine(engine)
122  {
123  fTPCRadius = fGeo->TPCRadius();
124  fTPCLength = fGeo->TPCLength()/2.;
125  fECALBarrelInnerRadius = fGeo->GetECALInnerBarrelRadius();
126  fECALBarrelOuterRadius = fGeo->GetECALOuterBarrelRadius();
127  fECALEndcapInnerRadius = fGeo->GetECALInnerEndcapRadius();
128  fECALEndcapOuterRadius = fGeo->GetECALOuterEndcapRadius();
129  fECALStartX = fGeo->GetECALEndcapStartX();
130  fECALEndX = fGeo->GetECALEndcapOuterX();
131 
132  PrintParameters();
133  }
CLHEP::HepRandomEngine & fEngine
double fECALEndcapOuterRadius
double fECALEndcapInnerRadius
double fECALBarrelOuterRadius
double fECALBarrelInnerRadius
gar::CAFHelper::~CAFHelper ( )

Definition at line 136 of file ParamSim_module.cc.

137  {
138 
139  }

Member Function Documentation

float gar::CAFHelper::GaussianSmearing ( const float  mean,
const float  sigma 
)
inline

Definition at line 114 of file ParamSim_module.cc.

114  {
115  CLHEP::RandGauss GausRand(fEngine);
116  return GausRand.fire(mean, sigma);;
117  }
CLHEP::HepRandomEngine & fEngine
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
Definition: statistics.cc:16
float gar::CAFHelper::GetRamdomNumber ( )
inline

Definition at line 108 of file ParamSim_module.cc.

108  {
109  CLHEP::RandFlat FlatRand(fEngine);
110  return FlatRand.fire();;
111  }
CLHEP::HepRandomEngine & fEngine
bool gar::CAFHelper::hasDecayedInCalo ( const TVector3 &  point)
inline

Definition at line 224 of file ParamSim_module.cc.

225  {
226  return PointInCalo(point);
227  }
bool PointInCalo(const TVector3 &point)
bool gar::CAFHelper::isBarrel ( const TVector3 &  point)
inline

Definition at line 230 of file ParamSim_module.cc.

231  {
232  bool isBarrel = false;
233  float theta = std::atan(fECALBarrelInnerRadius / std::abs(fECALStartX) ); //angle for barrel/endcap transition
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()) ); //angle for barrel/endcap transition for the point
236 
237  if( theta_point > theta ) isBarrel = true;
238  return isBarrel;
239  }
bool isBarrel(const TVector3 &point)
T abs(T value)
double fECALBarrelInnerRadius
bool gar::CAFHelper::isEndcap ( const TVector3 &  point)
inline

Definition at line 242 of file ParamSim_module.cc.

243  {
244  bool isEndcap = false;
245  if( !isBarrel(point) ) isEndcap = true;
246  return isEndcap;
247  }
bool isBarrel(const TVector3 &point)
bool isEndcap(const TVector3 &point)
bool gar::CAFHelper::isThroughCalo ( const TVector3 &  point)
inline

Definition at line 218 of file ParamSim_module.cc.

219  {
220  return !PointInTPC(point) && !PointStopBetween(point) && !PointInCalo(point);
221  }
bool PointInTPC(const TVector3 &point)
bool PointStopBetween(const TVector3 &point)
bool PointInCalo(const TVector3 &point)
bool gar::CAFHelper::PointInCalo ( const TVector3 &  point)
inline

Definition at line 188 of file ParamSim_module.cc.

189  {
190  //Barrel Radius 278 cm
191  //Endcap starts at 364 cm
192  bool isInCalo = false;
193  float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
194  //in the Barrel
195  if( r_point > fECALBarrelInnerRadius && r_point < fECALBarrelOuterRadius && std::abs(point.X()) < fECALStartX ) isInCalo = true;
196  //in the Endcap
197  if( r_point < fECALEndcapOuterRadius && std::abs(point.X()) > fECALStartX && std::abs(point.X()) < fECALEndX ) isInCalo = true;
198 
199  return isInCalo;
200  }
T abs(T value)
double fECALEndcapOuterRadius
double fECALBarrelOuterRadius
double fECALBarrelInnerRadius
bool gar::CAFHelper::PointInFiducial ( const TVector3 &  point)
inline

Definition at line 157 of file ParamSim_module.cc.

158  {
159  //TPC Fiducial volume defined as
160  //R < 260 cm
161  //|X| < 250 cm
162  bool isInFiducial = true;
163 
164  float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
165  if( r_point > fTPCFidRadius ) isInFiducial = false;
166  if( r_point < fTPCFidRadius && std::abs(point.X()) > fTPCFidLength ) isInFiducial = false;
167 
168  return isInFiducial;
169  }
const double fTPCFidRadius
T abs(T value)
const double fTPCFidLength
bool gar::CAFHelper::PointInTPC ( const TVector3 &  point)
inline

Definition at line 172 of file ParamSim_module.cc.

173  {
174  //TPC volume defined as
175  //R < 260 cm
176  //|X| < 250 cm
177  if(PointInFiducial(point)) return true;
178  bool isInTPC = true;
179 
180  float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
181  if( r_point > fTPCRadius ) isInTPC = false;
182  if( r_point < fTPCRadius && std::abs(point.X()) > fTPCLength ) isInTPC = false;
183 
184  return isInTPC;
185  }
bool PointInFiducial(const TVector3 &point)
T abs(T value)
bool gar::CAFHelper::PointStopBetween ( const TVector3 &  point)
inline

Definition at line 203 of file ParamSim_module.cc.

204  {
205  //Barrel Radius 278 cm
206  //Endcap starts at 364 cm
207  bool isStopBetween = false;
208  float r_point = std::sqrt( point.Y()*point.Y() + point.Z()*point.Z() );
209  //in the Barrel
210  if( r_point < fECALBarrelInnerRadius && r_point > fTPCRadius && std::abs(point.X()) < fTPCLength ) isStopBetween = true;
211  //in the Endcap
212  if( r_point < fECALEndcapOuterRadius && std::abs(point.X()) > fTPCLength && std::abs(point.X()) < fECALStartX ) isStopBetween = true;
213 
214  return isStopBetween;
215  }
T abs(T value)
double fECALEndcapOuterRadius
void gar::CAFHelper::PrintParameters ( )
private

Definition at line 142 of file ParamSim_module.cc.

143  {
144  std::cout << " ==== CAFHelper Parameters ==== " << std::endl;
145  std::cout << "TPC Radius " << fTPCRadius << " cm" << std::endl;
146  std::cout << "TPC Length " << fTPCLength << " cm" << std::endl;
147  std::cout << "ECAL Barrel Inner Radius " << fECALBarrelInnerRadius << " cm" << std::endl;
148  std::cout << "ECAL Barrel Outer Radius " << fECALBarrelOuterRadius << " cm" << std::endl;
149  std::cout << "ECAL Endcap Inner Radius " << fECALEndcapInnerRadius << " cm" << std::endl;
150  std::cout << "ECAL Endcap Outer Radius " << fECALEndcapOuterRadius << " cm" << std::endl;
151  std::cout << "ECAL Endcap Start X " << fECALStartX << " cm" << std::endl;
152  std::cout << "ECAL Endcap End X " << fECALEndX << " cm" << std::endl;
153  std::cout << " ==== CAFHelper Parameters ==== " << std::endl;
154  }
double fECALEndcapOuterRadius
double fECALEndcapInnerRadius
QTextStream & endl(QTextStream &s)
double fECALBarrelOuterRadius
double fECALBarrelInnerRadius

Member Data Documentation

double gar::CAFHelper::fECALBarrelInnerRadius
private

Definition at line 99 of file ParamSim_module.cc.

double gar::CAFHelper::fECALBarrelOuterRadius
private

Definition at line 100 of file ParamSim_module.cc.

double gar::CAFHelper::fECALEndcapInnerRadius
private

Definition at line 101 of file ParamSim_module.cc.

double gar::CAFHelper::fECALEndcapOuterRadius
private

Definition at line 102 of file ParamSim_module.cc.

double gar::CAFHelper::fECALEndX
private

Definition at line 104 of file ParamSim_module.cc.

double gar::CAFHelper::fECALStartX
private

Definition at line 103 of file ParamSim_module.cc.

CLHEP::HepRandomEngine& gar::CAFHelper::fEngine
private

Definition at line 91 of file ParamSim_module.cc.

const double gar::CAFHelper::fTPCFidLength = 215.
private

Definition at line 95 of file ParamSim_module.cc.

const double gar::CAFHelper::fTPCFidRadius = 222.5
private

Definition at line 94 of file ParamSim_module.cc.

double gar::CAFHelper::fTPCLength
private

Definition at line 98 of file ParamSim_module.cc.

double gar::CAFHelper::fTPCRadius
private

Definition at line 97 of file ParamSim_module.cc.


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