//*-- Author : Paul Eugenio 126-Apr-1999
////////////////////////////////////////////////////////////////////////
// TMCFastCerenTrace
//
// This class is an object oriented version
// of mcfast trace common block.
//
// More information see Tracking in MCFast doc at:
//Begin_Html
/*
http://www-pat.fnal.gov/mcfast.html
*/
//End_Html
//
////////////////////////////////////////////////////////////////////////
#include
#include "TMCFastCerenTrace.h"
ClassImp(TMCFastCerenTrace)
TMCFastCerenTrace::TMCFastCerenTrace(struct trace_t *trace){
// Call FIll()
//
this->Fill(trace);
}
//____________________________________________________________________________
TMCFastCerenTrace::~TMCFastCerenTrace()
{
// Class destructor calls Clear()
//
Clear();
}
//_________________________________________________________
Double_t TMCFastCerenTrace::TraceTo(Double_t &Rmin, Double_t &Rmax, Double_t &Zmax){
// Extend the trace to Rmax or Zmax and return
// the total path length traversed in the annulus
// defined by Rmin, Rmax, tracepoint Z (which is at the cerenkov face),
// and Zmax. This routine assumes no magnetic field.
Int_t len=0,debug=0;
Double_t R = this->GetR();
Double_t R_sq = R*R;
Double_t Rmin_sq = Rmin*Rmin;
Double_t Rmax_sq = Rmax*Rmax;
Double_t X= this->GetX();
Double_t Y= this->GetY();
Double_t Z= this->GetZ();
Double_t Beta= GetP()/GetE();
Double_t Betax= GetPx()/GetE();
Double_t Betay= GetPy()/GetE();
Double_t Betaz= GetPz()/GetE();
Double_t t = 1.0/Beta; // step one cm at a time
if (debug)
cerr<<"Starting Trace at: X Y Z R_sq: "<0){
cerr<<"Particle is moving forward! Exiting in TMCFastCerenTrace::TraceTo()!\n";
exit(-1);
}
if(!( (XZmax))
cerr<<"Warning in TMCFastCerenTrace::TraceTo()!!"
<<" Initial track position is out of bounds\n";
while(R_sqRmin_sq)
len++;// add to length only if inside of annulus
//if (debug)
// cerr<<"\tX Y Z R_sq: "<GetR();
Double_t R_sq = R*R;
Double_t Rmin_sq = Rmin*Rmin;
Double_t Rmax_sq = Rmax*Rmax;
Double_t X= this->GetX();
Double_t Y= this->GetY();
Double_t Z= this->GetZ();
Double_t Beta= GetP()/GetE();
Double_t Betax= GetPx()/GetE();
Double_t Betay= GetPy()/GetE();
Double_t Betaz= GetPz()/GetE();
Double_t t = 1.0/Beta; // step one cm at a time
Double_t phi_per_seg=2.0*TMath::Pi()/((Double_t)nSegments);
if (debug)
cerr<<"Starting Trace at: X Y Z R_sq: "<0){
cerr<<"Particle is moving forward! Exiting in TMCFastCerenTrace::TraceTo()!\n";
exit(-1);
}
if(!( (XZmax))
cerr<<"Warning in TMCFastCerenTrace::TraceTo()!!"
<<" Initial track position is out of bounds\n";
while(R_sqRmin_sq){
Int_t Seg = (Int_t) TMath::Floor(phi/phi_per_seg);
len[Seg]++;// add to length only if inside of annulus
//cerr<<"phi, phi_per_seg "<
// where No = 90/cm which assumes eff_collection ~= 90% and
// eff_photo_cathode = 27%. Theta_c is the Cerenkov cone
// half-angle where Cos(Theta_c) = 1/(indexOfRefraction*Beta).
//
// It returns "0" if the particle is below threshold (i.e. negative
// Theta_c).
Double_t Beta = this->GetBeta();
Int_t Npe =
(Int_t)(90*PathLength*(1.0 - 1.0/(indexOfRefraction*indexOfRefraction*Beta*Beta)));
if(Npe<0)
return 0;
else
return Npe;
}
//____________________________________________________________
Int_t TMCFastCerenTrace::Npe(Double_t indexOfRefraction,
Double_t &Rmin, Double_t &Rmax, Double_t &Zmax){
// Given the index of refraction, Rmin, Rmax, and Zmax return
// the mean number of photoelectrons that should be detected in
// the cverenkov.
// from Review of Particle Physics [ The European Physical Journal C,
// Vol 3,Num 1-4 Sec 25.3 page 155 1998.]
//
// Npe = No * Length*
// where No = 90/cm which assumes eff_collection ~= 90% and
// eff_photo_cathode = 27%. Theta_c is the Cerenkov cone
// half-angle where Cos(Theta_c) = 1/(indexOfRefraction*Beta).
//
// It returns "0" if the particle is below threshold (i.e. negative
// Theta_c).
Double_t L = this->TraceTo(Rmin, Rmax,Zmax);
Double_t Beta = this->GetBeta();
Int_t Npe =
(Int_t)(90*L*(1.0 - 1.0/(indexOfRefraction*indexOfRefraction*Beta*Beta)));
if(Npe<0)
return 0;
else
return Npe;
}
//____________________________________________________________________________
void TMCFastCerenTrace::Print(ostream *os){
// Prints TMCFastCerenTrace object
//
// This function is also used
// to overload &operator<<
//
// For example;
// cout << trace;
//
// where trace is an instance of TMCFastCerenTrace
TMCFastTrace::Print(os);
Double_t R1=20,R2=95,Z2=550;
//Int_t nseg=40;
//Double_t seg[40];
*os<<"\t\tR: "<