Public Member Functions | Private Attributes

WCSimIsoChronTransform Class Reference

#include "WCSimIsoChronTransform.hh"

List of all members.

Public Member Functions

 WCSimIsoChronTransform ()
 WCSimIsoChronTransform (Double_t nBinsV, Double_t binscale)
 ~WCSimIsoChronTransform ()
void Reset ()
TH3D * IsoChronTransform (WCSimRecoCluster *theHits)
void ApplyTransform (vector< vector< double > > thehits, vector< double > VxHypothesis)
void ApplyTransformChromCorrected (vector< vector< double > > thehits, vector< double > VxHypothesis, Int_t ncolorbins, Double_t lowcolor, Double_t highcolor)
void ProcessHit (vector< double > aHit, vector< double > VxHypothesis)
void ProcessHitChromCorr (vector< double > aHit, vector< double > VxHypothesis, Int_t ncolorbins, Double_t lowcolor, Double_t highcolor)
void SetConstantIndexofRefraction (double newn)
void SetConstantSpeedofParticle (double newc)
void AddWaterModel (WCSimWaterModel *wm)
vector< double > FillIsoChronRing_pixel (vector< double > VxHypothesis, TVector3 hvect, vector< double > priorpixel, Double_t alpha, Double_t s1, Double_t theweight)
Double_t CalcMaxAlpha (Double_t dD, Double_t dT, Double_t theindex)
Double_t CalcMaxEmissionAngle (Double_t dD, Double_t dT, Double_t theindex)
Double_t CalcS1 (Double_t alpha, Double_t dD, Double_t dT, Double_t theindex)
Double_t CalcS2 (Double_t alpha, Double_t dD, Double_t dT, Double_t theindex)
Double_t CalcAlpha (Double_t s1, Double_t dD, Double_t dT, Double_t theindex)
TGraph * IndexVsS1 (Double_t dD, Double_t dT)
TH1D * getBCDist ()
TH1D * getMaxAlphaDist ()
TH1D * getMaxThetaCDist ()
TH1D * getMinS1Dist ()
TH1D * getnDist ()
TH2D * getS1vsAlpha ()
TH2D * XYProjection ()
TH2D * XZProjection (double bclimit)
TH2D * YZProjection ()
TH2D * XYSlice ()
TH2D * XZSlice ()
TH2D * YZSlice ()

Private Attributes

WCSimWaterModel_theWM
vector< vector< double > > isochronarray
TH3D * _htrackreco
TH3D ** _htrackreco_color
TH3D ** _htrackreco_resolution
double _n
double _c
TH1D * _thexb
TH1D * _theyb
TH1D * _thezb
TH2D * theprojxz
TH2D * theprojxy
TH2D * theprojyz
TH1D * _maxAlphadist
TH1D * _maxThetaCdist
TH1D * _bcontentsdist
TH1D * _minS1dist
TH1D * _nDist
TH2D * _S1vsAlphadist
int nbx
int nby
int nbz
double lx
double hx
double ly
double hy
double lz
double hz
bool iswatermodel
bool usewatermodel

Detailed Description

Definition at line 17 of file WCSimIsoChronTransform.hh.


Constructor & Destructor Documentation

WCSimIsoChronTransform::WCSimIsoChronTransform (  ) 

Definition at line 78 of file WCSimIsoChronTransform.cc.

References _bcontentsdist, _c, _htrackreco, _maxAlphadist, _maxThetaCdist, _minS1dist, _n, _nDist, _S1vsAlphadist, _thexb, _theyb, _thezb, hx, hy, hz, lx, ly, lz, nbx, nby, nbz, theprojxy, theprojxz, and theprojyz.

                                              {

  _n=1.34689;
  _c=299.792458;
  
  nbx=110;
  nby=200;
  nbz=200;
  lx=-95.;
  hx=1005.;
  ly=-995.;
  hy=1005.;
  lz=-995.;
  hz=1005.;
  
  _htrackreco = new TH3D("soh","soh",nbx,lx,hx,nby,ly,hy,nbz,lz,hz);
  _thexb = new TH1D("xb","xb",nbx,lx,hx);
  _theyb = new TH1D("yb","yb",nby,ly,hy);
  _thezb = new TH1D("zb","zb",nbz,lz,hz);

  _maxAlphadist = new TH1D("maxalpha","maxalpha",200,-3.14159,3.14159);
  _maxThetaCdist = new TH1D("maxthetac","maxthetac",12000,-3.14159,3.14159);
  _bcontentsdist = new TH1D("bch","bch",50000,-0.5,50000.5);
  _minS1dist= new TH1D("ms1","ms1",50000,0.,5000.);
  _nDist = new TH1D("ndist","ndist",400,1.2,1.4);
  _S1vsAlphadist = new TH2D("s1va","s1va",5000,0.,5000.,5000,0,5000.);

  theprojxz = new TH2D("sohpxz","sohpxz",nbx,lx,hx,nbz,lz,hz);;
  theprojxy = new TH2D("sohpxy","sohpxy",nbx,lx,hx,nby,ly,hy);;
  theprojyz = new TH2D("sohpyz","sohpyz",nby,ly,hy,nbz,lz,hz);;

}

WCSimIsoChronTransform::WCSimIsoChronTransform ( Double_t  nBinsV,
Double_t  binscale 
)

Definition at line 17 of file WCSimIsoChronTransform.cc.

References _bcontentsdist, _c, _htrackreco, _maxAlphadist, _maxThetaCdist, _minS1dist, _n, _nDist, _S1vsAlphadist, _thexb, _theyb, _thezb, hx, hy, hz, lx, ly, lz, nbx, nby, nbz, theprojxy, theprojxz, and theprojyz.

                                                                                {

  _n=1.34689;
  _c=299.792458;

  if((int)nBinsV%2==0){

    nbx=nBinsV;
    nby=nBinsV;
    nbz=nBinsV;

    double halfbin = binscale/2.;
    double nbinshalf = nBinsV/2.;
    
    lx = -(nbinshalf*binscale)-halfbin;
    hx = (nbinshalf*binscale)-halfbin;
    ly = -(nbinshalf*binscale)-halfbin;
    hy = (nbinshalf*binscale)-halfbin;
    lz = -(nbinshalf*binscale)-halfbin;
    hz = (nbinshalf*binscale)-halfbin;

    cout<<lx<<" "<<hx<<endl;
  }
  else{

    nbx=nBinsV;
    nby=nBinsV;
    nbz=nBinsV;

    double halfbin = binscale/2.;
    double nbinshalf = (nBinsV-1)/2.;
    
    lx = -(nbinshalf*binscale)-halfbin;
    hx = (nbinshalf*binscale)+halfbin;
    ly = -(nbinshalf*binscale)-halfbin;
    hy = (nbinshalf*binscale)+halfbin;
    lz = -(nbinshalf*binscale)-halfbin;
    hz = (nbinshalf*binscale)+halfbin;

    cout<<lx<<" "<<hx<<endl;
  }
  
  _htrackreco = new TH3D("soh","soh",nbx,lx,hx,nby,ly,hy,nbz,lz,hz);
  _thexb = new TH1D("xb","xb",nbx,lx,hx);
  _theyb = new TH1D("yb","yb",nby,ly,hy);
  _thezb = new TH1D("zb","zb",nbz,lz,hz);

  _maxAlphadist = new TH1D("maxalpha","maxalpha",200,-3.14159,3.14159);
  _maxThetaCdist = new TH1D("maxthetac","maxthetac",12000,-3.14159,3.14159);
  _bcontentsdist = new TH1D("bch","bch",50000,-0.5,50000.5);
  _minS1dist= new TH1D("ms1","ms1",50000,0.,5000.);
  _nDist = new TH1D("ndist","ndist",400,1.2,1.4);
  _S1vsAlphadist = new TH2D("s1va","s1va",5000,0.,5000.,5000,0,5000.);

  theprojxz = new TH2D("sohpxz","sohpxz",nbx,lx,hx,nbz,lz,hz);;
  theprojxy = new TH2D("sohpxy","sohpxy",nbx,lx,hx,nby,ly,hy);;
  theprojyz = new TH2D("sohpyz","sohpyz",nby,ly,hy,nbz,lz,hz);;

}

WCSimIsoChronTransform::~WCSimIsoChronTransform (  ) 

Definition at line 111 of file WCSimIsoChronTransform.cc.

References _bcontentsdist, _htrackreco, _maxAlphadist, _maxThetaCdist, _minS1dist, _nDist, _S1vsAlphadist, _thexb, _theyb, _thezb, theprojxy, theprojxz, and theprojyz.

{

  delete _htrackreco;
  delete _maxAlphadist;
  delete _maxThetaCdist;
  delete _bcontentsdist;
  delete _minS1dist;
  delete _S1vsAlphadist;
  delete _nDist;
  delete _thexb;
  delete _theyb;
  delete _thezb;
  delete theprojxz;
  delete theprojxy;
  delete theprojyz;

}


Member Function Documentation

void WCSimIsoChronTransform::AddWaterModel ( WCSimWaterModel wm  ) 

Definition at line 563 of file WCSimIsoChronTransform.cc.

References _theWM, and iswatermodel.

{
  iswatermodel=true;
  _theWM = wm;
}

void WCSimIsoChronTransform::ApplyTransform ( vector< vector< double > >  thehits,
vector< double >  VxHypothesis 
)

Definition at line 261 of file WCSimIsoChronTransform.cc.

References ProcessHit().

{
  for(int i=0; i<(int)(thehits.size()); i++){

    if(i%1000==0) cout<<"reconstructing from hits...hitcount: "<<i<<endl;

    vector<double> hcoo = thehits.at(i);
    this->ProcessHit(hcoo,hypVtx);
  }
}

void WCSimIsoChronTransform::ApplyTransformChromCorrected ( vector< vector< double > >  thehits,
vector< double >  VxHypothesis,
Int_t  ncolorbins,
Double_t  lowcolor,
Double_t  highcolor 
)

Definition at line 272 of file WCSimIsoChronTransform.cc.

References iswatermodel, and ProcessHitChromCorr().

{
  if( (!iswatermodel) || (ncolorbins==0) ){
    if(!iswatermodel){
      cout<<"need to build WCSimWaterModel before calling this routine!!!"<<endl;;
    }
    if(ncolorbins==0){
      cout<<"need more than 0 color bins to run this routine!!!"<<endl;
    }
  }
  else{

    for(int i=0; i<(int)(thehits.size()); i++){
      
      if(i%1000==0) cout<<"reconstructing from hits...hitcount: "<<i<<endl;
      vector<double> hcoo = thehits.at(i);
      this->ProcessHitChromCorr(hcoo,hypVtx,ncolorbins,lowcolor,highcolor);      
    }
  }
}

Double_t WCSimIsoChronTransform::CalcAlpha ( Double_t  s1,
Double_t  dD,
Double_t  dT,
Double_t  theindex 
)

Definition at line 184 of file WCSimIsoChronTransform.cc.

References _c.

                                                                                            {

  double s2 = (_c*dT -s1)/ni;
  double cosalpha;
  if(s1!=0) cosalpha = (s1*s1 + dD*dD - s2*s2)/(2*s1*dD);
  double alpha = acos(cosalpha);

  return alpha;
}

Double_t WCSimIsoChronTransform::CalcMaxAlpha ( Double_t  dD,
Double_t  dT,
Double_t  theindex 
)

Definition at line 135 of file WCSimIsoChronTransform.cc.

References _c.

Referenced by CalcMaxEmissionAngle(), IndexVsS1(), ProcessHit(), and ProcessHitChromCorr().

                                                                                  {

   double qA=4*(ni*ni*ni*ni)*dD*dD;
   double qB=-8*(ni*ni)*(_c*dT)*dD;
   double qC= (4*dT*dT*_c*_c) - (4*((ni*ni) - 1)*( (ni*ni*dD*dD) - (dT*dT*_c*_c) ));


   double maxa=-555555;
   if( (qB*qB) > (4*qA*qC) ){
     double cosa = (-qB + sqrt(qB*qB - 4*qA*qC))/(2*qA);
     maxa = acos(cosa);

     double cosalphap = cos(maxa + 0.01);
     double qA1=((ni*ni)-1);
     double qB1=2*((_c*dT)-(ni*ni*dD*cosalphap));
     double qC1=(ni*ni*dD*dD)-(_c*_c*dT*dT);

     double cosalpham = cos(maxa - 0.01);
     qA1=((ni*ni)-1);
     qB1=2*((_c*dT)-(ni*ni*dD*cosalpham));
     qC1=(ni*ni*dD*dD)-(_c*_c*dT*dT);

   } else{
     //   cout<<"CalcMaxAlpha::Causally impossible "<<qB*qB<<" "<<(4*qA*qC)<<endl;
   }

   return maxa;
}

Double_t WCSimIsoChronTransform::CalcMaxEmissionAngle ( Double_t  dD,
Double_t  dT,
Double_t  theindex 
)

Definition at line 165 of file WCSimIsoChronTransform.cc.

References CalcMaxAlpha(), and CalcS1().

Referenced by ProcessHit(), and ProcessHitChromCorr().

                                                                                          {

  double maxalpha=this->CalcMaxAlpha(dD,dT,ni);
  double mins1 = this->CalcS1(maxalpha,dD,dT,ni);
  double ds2x = dD - mins1*cos(maxalpha);
  double ds2y = mins1*sin(maxalpha);
  double ds2 = sqrt( ds2x*ds2x + ds2y*ds2y );
  double sinwangle;
  if(ds2>0.) sinwangle = dD*sin(maxalpha)/ds2;
  double wangle = asin(sinwangle); 
   //  double maxemissangle = (3.14159265358979 - wangle);
  double maxemissangle=-55555;
  if(mins1>0) maxemissangle= wangle;

  //  cout<<sinwangle<<" "<<wangle<<" "<<maxemissangle<<" "<<mins1<<" "<<ds2<<endl;
 
  return maxemissangle;
}

Double_t WCSimIsoChronTransform::CalcS1 ( Double_t  alpha,
Double_t  dD,
Double_t  dT,
Double_t  theindex 
)

Definition at line 195 of file WCSimIsoChronTransform.cc.

References _c.

Referenced by CalcMaxEmissionAngle(), CalcS2(), IndexVsS1(), ProcessHit(), and ProcessHitChromCorr().

{
   double theS1=-55555.;

   if(alpha>=0){
     double cosalpha = cos(alpha);
     
     double qA=((ni*ni)-1);
     double qB=2*((_c*dT)-(ni*ni*dD*cosalpha));
     double qC=(ni*ni*dD*dD)-(_c*_c*dT*dT);
     double sqrtterm=qB*qB - 4*qA*qC;
     if( fabs(sqrtterm)<0.0001 ) sqrtterm=0;     
     if( sqrtterm>=0 ){    

       theS1 = (-qB + sqrt(sqrtterm))/(2*qA);
     }
     else{ 
       //       cout<<"CalcS1::Causally Impossible "<<(qB*qB)<<" "<<(4*qA*qC)<<" "<<(qB*qB - 4*qA*qC)<<endl; 
     }
   }
   return theS1;
}

Double_t WCSimIsoChronTransform::CalcS2 ( Double_t  alpha,
Double_t  dD,
Double_t  dT,
Double_t  theindex 
)

Definition at line 218 of file WCSimIsoChronTransform.cc.

References CalcS1().

Referenced by ProcessHitChromCorr().

{
  double mins1 = this->CalcS1(alpha,dD,dT,ni);
  double ds2x = dD - mins1*cos(alpha);
  double ds2y = mins1*sin(alpha);
  double theS2 = sqrt( ds2x*ds2x + ds2y*ds2y );

  return theS2;
}

vector< double > WCSimIsoChronTransform::FillIsoChronRing_pixel ( vector< double >  VxHypothesis,
TVector3  hvect,
vector< double >  priorpixel,
Double_t  alpha,
Double_t  s1,
Double_t  theweight 
)

Definition at line 398 of file WCSimIsoChronTransform.cc.

References _htrackreco, _thexb, _theyb, and _thezb.

Referenced by ProcessHit(), and ProcessHitChromCorr().

{
  double thebeta=0;
  double xp=theR*cos(thealpha);
  double yp=theR*sin(thealpha);
  
  double pmag = hvect.Mag();
  TVector3 paradir = (1/pmag)*hvect;
  TVector3 yvect(0.,1.,0.);
  TVector3 pdu = (paradir.Cross(yvect));
  double perpmag = pdu.Mag();
  TVector3 perpdir = (1/perpmag)*pdu;
  TVector3 threevtx(VxHypothesis.at(0),VxHypothesis.at(1),VxHypothesis.at(2));
  
  vector<double> newpriorpixel;
  newpriorpixel.push_back(0.); newpriorpixel.push_back(0.); newpriorpixel.push_back(0.);
  newpriorpixel.push_back(0.); newpriorpixel.push_back(0.); newpriorpixel.push_back(0.);


  for(int j=0; j<200; j++){
        
    thebeta = (j*(3.14159265358979))/100.;
    
    TVector3 f1pos = (xp*paradir - yp*cos(thebeta)*perpdir + yp*sin(thebeta)*yvect);
    TVector3 f1neg = (xp*paradir + yp*cos(thebeta)*perpdir + yp*sin(thebeta)*yvect);
    
    TVector3 f2pos = (hvect-f1pos);
    TVector3 f2neg = (hvect-f1neg);

    f1pos+=threevtx;
    f1neg+=threevtx;
    f2pos+=threevtx;
    f2neg+=threevtx;
        
    int ixbp = _thexb->FindBin(f1pos.X());
    int iybp = _theyb->FindBin(f1pos.Y());
    int izbp = _thezb->FindBin(f1pos.Z());
    int ixbn = _thexb->FindBin(f1neg.X());
    int iybn = _theyb->FindBin(f1neg.Y());
    int izbn = _thezb->FindBin(f1neg.Z());
    
    if( (ixbp!=priorpixel.at(0)) || (iybp!=priorpixel.at(1)) || (izbp!=priorpixel.at(2)) || (ixbn!=priorpixel.at(3)) || (iybn!=priorpixel.at(4)) || (izbn!=priorpixel.at(5))){
      
      double bc =_htrackreco->GetBinContent(ixbp,iybp,izbp);
      _htrackreco->SetBinContent(ixbp,iybp,izbp,(bc+theweight));
      
      //      bc = _htrackreco->GetBinContent(ixbn,iybn,izbn);
      //      _htrackreco->SetBinContent(ixbn,iybn,izbn,(bc+theweight));
      newpriorpixel.at(0)=ixbp;
      newpriorpixel.at(1)=iybp;
      newpriorpixel.at(2)=izbp;
      
      newpriorpixel.at(3)=ixbn;
      newpriorpixel.at(4)=iybn;
      newpriorpixel.at(5)=izbn;
      
      priorpixel = newpriorpixel;
    }
  }

  return newpriorpixel;
}

TH1D * WCSimIsoChronTransform::getBCDist (  ) 

Definition at line 522 of file WCSimIsoChronTransform.cc.

References _bcontentsdist.

{
  return _bcontentsdist;
}

TH1D * WCSimIsoChronTransform::getMaxAlphaDist (  ) 

Definition at line 527 of file WCSimIsoChronTransform.cc.

References _maxAlphadist.

{
  return _maxAlphadist;
}

TH1D * WCSimIsoChronTransform::getMaxThetaCDist (  ) 

Definition at line 532 of file WCSimIsoChronTransform.cc.

References _maxThetaCdist.

{
  return _maxThetaCdist;
}

TH1D * WCSimIsoChronTransform::getMinS1Dist (  ) 

Definition at line 538 of file WCSimIsoChronTransform.cc.

References _minS1dist.

{
  return _minS1dist;
}

TH1D * WCSimIsoChronTransform::getnDist (  ) 

Definition at line 543 of file WCSimIsoChronTransform.cc.

References _nDist.

{
  return _nDist;
}

TH2D * WCSimIsoChronTransform::getS1vsAlpha (  ) 

Definition at line 548 of file WCSimIsoChronTransform.cc.

References _S1vsAlphadist.

{
  return _S1vsAlphadist;
}

TGraph * WCSimIsoChronTransform::IndexVsS1 ( Double_t  dD,
Double_t  dT 
)

Definition at line 230 of file WCSimIsoChronTransform.cc.

References CalcMaxAlpha(), and CalcS1().

{

  double minimalS1=1000000.;
  double minimalIndex=0.;
  double theindex_i=1.30;

  TGraph* s1vsindex = new TGraph(100);

  for(int i=0; i<100; i++)
    {
      double maxalpha_i=this->CalcMaxAlpha(dD,dT, theindex_i);
      double mins1_i=this->CalcS1(maxalpha_i,dD,dT, theindex_i);
      // double eang_i=this->CalcMaxEmissionAngle(dD,dT);
      bool past_thresh=false;
      s1vsindex->SetPoint(i,theindex_i,mins1_i);
      //      cout<<"fitting..."<<theindex_i<<" "<<mins1_i<<" "<<maxalpha_i<<" "<<eang_i<<" "<<acos(1/theindex_i)<<endl;

      theindex_i+=0.001;
    }
 
  return s1vsindex;
}

TH3D * WCSimIsoChronTransform::IsoChronTransform ( WCSimRecoCluster theHits  ) 

Definition at line 254 of file WCSimIsoChronTransform.cc.

References _htrackreco.

{

  return _htrackreco;
}

void WCSimIsoChronTransform::ProcessHit ( vector< double >  aHit,
vector< double >  VxHypothesis 
)

Definition at line 294 of file WCSimIsoChronTransform.cc.

References _maxAlphadist, _maxThetaCdist, _minS1dist, _n, _S1vsAlphadist, CalcMaxAlpha(), CalcMaxEmissionAngle(), CalcS1(), and FillIsoChronRing_pixel().

Referenced by ApplyTransform().

{

  TVector3 hitcoor(hitcoordinates.at(0),hitcoordinates.at(1),hitcoordinates.at(2));
  TVector3 hvect((hitcoordinates.at(0)-hypVtx.at(0)),(hitcoordinates.at(1)-hypVtx.at(1)),(hitcoordinates.at(2)-hypVtx.at(2)));

  double dD=hvect.Mag();
  double dT=hitcoordinates.at(3)-hypVtx.at(3);
  double theR; 
  double minalpha=0;
  double maxalpha = this->CalcMaxAlpha(dD,dT,_n);
  double maxemmang = this->CalcMaxEmissionAngle(dD,dT,_n);  
  double minS1val = this->CalcS1(maxalpha,dD,dT,_n); 

  _maxAlphadist->Fill(maxalpha);
  _maxThetaCdist->Fill(maxemmang);
  _minS1dist->Fill(minS1val);
  _S1vsAlphadist->Fill((minS1val*cos(maxalpha)),dD);

  vector<double> priorpixel;
  priorpixel.push_back(0.); priorpixel.push_back(0.); priorpixel.push_back(0.);
  priorpixel.push_back(0.); priorpixel.push_back(0.); priorpixel.push_back(0.);
  
  double alphastep=(maxalpha-minalpha)/1000.;
  theR=0;

  if(maxalpha>0){
    for(int i=999; i<1000; i++){
 
      double thealpha=minalpha+(i*alphastep);
      double theR = this->CalcS1(thealpha,dD,dT,_n);
      
      vector<double> newpp = this->FillIsoChronRing_pixel(hypVtx, hvect, priorpixel, thealpha, theR, 1.);
      priorpixel = newpp;
    }
  }
}

void WCSimIsoChronTransform::ProcessHitChromCorr ( vector< double >  aHit,
vector< double >  VxHypothesis,
Int_t  ncolorbins,
Double_t  lowcolor,
Double_t  highcolor 
)

Definition at line 333 of file WCSimIsoChronTransform.cc.

References _maxAlphadist, _maxThetaCdist, _minS1dist, _n, _nDist, _S1vsAlphadist, _theWM, CalcMaxAlpha(), CalcMaxEmissionAngle(), CalcS1(), CalcS2(), FillIsoChronRing_pixel(), WCSimWaterModel::FinlSpect(), and WCSimWaterModel::N_Index().

Referenced by ApplyTransformChromCorrected().

{

  TVector3 hitcoor(hitcoordinates.at(0),hitcoordinates.at(1),hitcoordinates.at(2));
  TVector3 hvect((hitcoordinates.at(0)-hypVtx.at(0)),(hitcoordinates.at(1)-hypVtx.at(1)),(hitcoordinates.at(2)-hypVtx.at(2)));

  double dD=hvect.Mag();
  double dT=hitcoordinates.at(3)-hypVtx.at(3);
  double theR; 
  double minalpha=0;

  double maxalpha = this->CalcMaxAlpha(dD,dT,_n);
  double maxemmang = this->CalcMaxEmissionAngle(dD,dT,_n);  
  double minS1val = this->CalcS1(maxalpha,dD,dT,_n); 

  _maxAlphadist->Fill(maxalpha);
  _maxThetaCdist->Fill(maxemmang);
  _minS1dist->Fill(minS1val);
  _S1vsAlphadist->Fill((minS1val*cos(maxalpha)),dD);

  vector<double> priorpixel;
  priorpixel.push_back(0.); priorpixel.push_back(0.); priorpixel.push_back(0.);
  priorpixel.push_back(0.); priorpixel.push_back(0.); priorpixel.push_back(0.);
  
  double alphastep=(maxalpha-minalpha)/1000.;
  theR=0;

  Double_t thecolor_i = lowcolor;
  Double_t colorincrement = (highcolor-lowcolor)/((Double_t)ncolorbins);

  vector<double> s2vect;
  vector<double> s1vect;
  vector<double> alphavect;
  double colorNorm=0;

  for(int i=0; i<ncolorbins; i++){
    double theindex_i=_theWM->N_Index(thecolor_i);
    double malpha = this->CalcMaxAlpha(dD,dT,theindex_i);
    double s_2 = this->CalcS2(malpha,dD,dT,theindex_i);
    s2vect.push_back(s_2);
    s1vect.push_back(this->CalcS1(malpha,dD,dT,theindex_i));
    alphavect.push_back(malpha);
    colorNorm+=(_theWM->FinlSpect(thecolor_i,s_2));
    thecolor_i+=colorincrement;
  }
  
  if(colorNorm>0){
    thecolor_i = lowcolor;
    for(int i=0; i<ncolorbins; i++){
      double theindex_i=_theWM->N_Index(thecolor_i);
      double theweight_i=(_theWM->FinlSpect(thecolor_i,(s2vect.at(i))))/colorNorm;
      _nDist->Fill(theindex_i,theweight_i);
      
      vector<double> newpp = this->FillIsoChronRing_pixel(hypVtx, hvect, priorpixel, (alphavect.at(i)), (s1vect.at(i)), theweight_i);
      priorpixel = newpp;
      
      thecolor_i+=colorincrement;
    }
  }
  else{
    cout<<"Color Norm is Zero!!!"<<endl;
  }  
}

void WCSimIsoChronTransform::Reset (  ) 
void WCSimIsoChronTransform::SetConstantIndexofRefraction ( double  newn  ) 

Definition at line 553 of file WCSimIsoChronTransform.cc.

References _n.

{
  _n=newn;
}

void WCSimIsoChronTransform::SetConstantSpeedofParticle ( double  newc  ) 

Definition at line 558 of file WCSimIsoChronTransform.cc.

References _c.

{
  _c=newc;
}

TH2D * WCSimIsoChronTransform::XYProjection (  ) 

Definition at line 462 of file WCSimIsoChronTransform.cc.

References theprojxy.

{
  return theprojxy;
}

TH2D * WCSimIsoChronTransform::XYSlice (  ) 

Definition at line 504 of file WCSimIsoChronTransform.cc.

{
  TH2D* theslice;
  return theslice;
}

TH2D * WCSimIsoChronTransform::XZProjection ( double  bclimit  ) 

Definition at line 467 of file WCSimIsoChronTransform.cc.

References _bcontentsdist, _htrackreco, nbx, nby, nbz, and theprojxz.

{
  cout<<"starting XZProjection..."<<endl;

   for(int i=0; i<nbx; i++){
     //     cout<<i<<endl;
     for(int j=0; j<nbz; j++){

       double zsum=0;
       double zmax=0;

       for(int k=0; k<nby; k++){

         double nbc = _htrackreco->GetBinContent((i+1),(k+1),(j+1));
         //      cout<<"here now..."<<i<<" "<<j<<" "<<k<<" "<<nbc<<endl;
         if(nbc>=0) _bcontentsdist->Fill(nbc);
         //      if(nbc>0) cout<<i<<" "<<j<<" "<<k<<" "<<nbc<<endl;
         if(nbc>bclimit) zsum+=nbc;
         if(nbc>zmax) zmax=nbc;
       }

       //       if(zsum==0) zsum=1;
       theprojxz->SetBinContent((i+1),(j+1),zsum);
       //      if(zmax>400) sohp->SetBinContent((i+1),(j+1),zmax);
       //       else sohp->SetBinContent((i+1),(j+1),2);
       //       if(zsum==0) sohp->SetBinContent((i+1),(j+1),2);
     }
   }

  return theprojxz;
}

TH2D * WCSimIsoChronTransform::XZSlice (  ) 

Definition at line 510 of file WCSimIsoChronTransform.cc.

{
  TH2D* theslice;
  return theslice;
}

TH2D * WCSimIsoChronTransform::YZProjection (  ) 

Definition at line 499 of file WCSimIsoChronTransform.cc.

References theprojyz.

{
  return theprojyz;
}

TH2D * WCSimIsoChronTransform::YZSlice (  ) 

Definition at line 516 of file WCSimIsoChronTransform.cc.

{
  TH2D* theslice;
  return theslice;
}


Member Data Documentation

double WCSimIsoChronTransform::_c [private]

Definition at line 65 of file WCSimIsoChronTransform.hh.

Definition at line 66 of file WCSimIsoChronTransform.hh.

double WCSimIsoChronTransform::_n [private]

Definition at line 60 of file WCSimIsoChronTransform.hh.

Referenced by AddWaterModel(), and ProcessHitChromCorr().

double WCSimIsoChronTransform::hx [private]

Definition at line 86 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform().

double WCSimIsoChronTransform::hy [private]

Definition at line 88 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform().

double WCSimIsoChronTransform::hz [private]

Definition at line 90 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform().

vector< vector<double> > WCSimIsoChronTransform::isochronarray [private]

Definition at line 62 of file WCSimIsoChronTransform.hh.

Definition at line 92 of file WCSimIsoChronTransform.hh.

Referenced by AddWaterModel(), and ApplyTransformChromCorrected().

double WCSimIsoChronTransform::lx [private]

Definition at line 85 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform().

double WCSimIsoChronTransform::ly [private]

Definition at line 87 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform().

double WCSimIsoChronTransform::lz [private]

Definition at line 89 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform().

Definition at line 82 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform(), and XZProjection().

Definition at line 83 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform(), and XZProjection().

Definition at line 84 of file WCSimIsoChronTransform.hh.

Referenced by WCSimIsoChronTransform(), and XZProjection().

Definition at line 93 of file WCSimIsoChronTransform.hh.


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