Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MoqQuantities Class Reference

#include <MoqQuantities.h>

Inheritance diagram for MoqQuantities:

MoqBase MoqAnalysis List of all members.

Public Member Functions

 MoqQuantities (TChain *chainSR=0, TChain *chainMC=0, TChain *chainTH=0, TChain *chainEM=0)
 MoqQuantities (JobC *, string, int)
 ~MoqQuantities ()
Bool_t IsTrack ()
Bool_t IsSingleTrack ()
Bool_t PassCuts (Int_t itrk)
Bool_t PassTrackCuts (Int_t itrk)
Bool_t IsFidAll (Int_t itrk=0)
Int_t INu (Int_t itr=0)
Int_t IAction (Int_t itr=0)
Int_t IResonance (Int_t itr=0)
Float_t Y (Int_t itr=0)
Float_t W2 (Int_t itr=0)
Float_t TrueNuEnergy (Int_t itr=0)
Float_t * TrueVtx (Int_t itr=0)
Float_t TrueMuEnergy (Int_t itr=0)
Float_t TrueMuQP (Int_t itr=0)
Float_t TrueShwEnergy (Int_t itr=0)
Float_t GetTrueShwSC (Int_t itr=0)
Double_t TrueVxB (Int_t itr=0)
Float_t RecoMuEnergy (Int_t opt=0, Int_t itrk=0)
Float_t RecoMuQP (Int_t itrk=0)
Float_t GetNonTrkSC (Int_t itrk=0, Int_t npln=0)
Float_t GetShwSC (Int_t itrk=0)
Float_t RecoShwEnergy (Int_t opt=0)
Int_t GetChargeSign (Int_t itrk=0)
Float_t RecoQENuEnergy (Int_t itrk=0)
Double_t VxB (Int_t itrk=0)
void MakeHistoFile (std::string)

Protected Member Functions

Double_t SwimToGetVxB (TVector3, TVector3, Int_t, Double_t)

Constructor & Destructor Documentation

MoqQuantities::MoqQuantities TChain *  chainSR = 0,
TChain *  chainMC = 0,
TChain *  chainTH = 0,
TChain *  chainEM = 0
 

Definition at line 18 of file MoqQuantities.cxx.

References MoqBase::Clear(), and MoqBase::InitChain().

00020 {
00021 
00022   if(!chainSR) {
00023     record = 0;
00024     emrecord = 0;
00025     mcrecord = 0;
00026     threcord = 0;
00027     Clear();
00028     whichSource = -1;
00029     isMC = true;
00030     isTH = true;
00031     isEM = true;
00032     Nentries = -1;
00033     return;
00034   }
00035 
00036 
00037   
00038   InitChain(chainSR,chainMC,chainTH,chainEM);
00039   whichSource = 0;
00040 
00041 }

MoqQuantities::MoqQuantities JobC ,
string  ,
int 
 

Definition at line 45 of file MoqQuantities.cxx.

References MoqBase::Clear().

00046 {
00047   record = 0;
00048   emrecord = 0;
00049   mcrecord = 0;
00050   threcord = 0;
00051   Clear();
00052   isMC = true;
00053   isTH = true;
00054   isEM = true;
00055   Nentries = entries;
00056   whichSource = 1;
00057   jcPath = path;
00058   fJC = j;
00059   fChain = NULL;
00060 
00061 
00062 }

MoqQuantities::~MoqQuantities  ) 
 

Definition at line 66 of file MoqQuantities.cxx.

00067 {
00068 
00069 }


Member Function Documentation

Int_t MoqQuantities::GetChargeSign Int_t  itrk = 0  ) 
 

Definition at line 368 of file MoqQuantities.cxx.

References RecoMuQP().

Referenced by RecoQENuEnergy(), and VxB().

00368                                             {  
00369   if(RecoMuQP(itrk)>0) return 1;
00370   return -1;
00371 }

Float_t MoqQuantities::GetNonTrkSC Int_t  itrk = 0,
Int_t  npln = 0
 

Definition at line 272 of file MoqQuantities.cxx.

References MoqBase::LoadTrack(), NtpSREventSummary::nstrip, NtpSRTrack::nstrip, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRVertex::plane, NtpSRStrip::plane, NtpSRPulseHeight::sigcor, NtpSRTrack::stp, NtpSRRecord::stp, and NtpSRTrack::vtx.

00272                                                        {
00273   
00274   Float_t Summed_Stp_SC = 0;
00275   Float_t Summed_Trk_SC = 0;
00276   
00277   bool useAll = false;
00278   if(npln<=0) useAll=true;  //Most basic thing in the world ever: 
00279                             //if it's not in the track it's in the shower
00280   
00281   TClonesArray& stripArray = *(record->stp);
00282   if(LoadTrack(itrk)) {
00283     Int_t numtrkstp = ntpTrack->nstrip;
00284     for(Int_t i=0;i<numtrkstp;i++){
00285       Int_t index = ntpTrack->stp[i];
00286       ntpStrip = dynamic_cast<NtpSRStrip *>(stripArray[index]);
00287       if((ntpStrip->plane <= ntpTrack->vtx.plane + npln
00288           && ntpStrip->plane >= ntpTrack->vtx.plane - npln)||useAll){
00289         Summed_Trk_SC += ntpStrip->ph0.sigcor + ntpStrip->ph1.sigcor;
00290       }
00291     }
00292   }
00293   
00294   for(Int_t i=0;i<int(eventSummary->nstrip);i++) {
00295     if((ntpStrip->plane <= ntpTrack->vtx.plane + npln
00296         && ntpStrip->plane >= ntpTrack->vtx.plane - npln)||useAll){
00297       Summed_Stp_SC += ntpStrip->ph0.sigcor + ntpStrip->ph1.sigcor;
00298     }
00299   }
00300   return Summed_Stp_SC - Summed_Trk_SC;
00301 }

Float_t MoqQuantities::GetShwSC Int_t  itrk = 0  ) 
 

Definition at line 305 of file MoqQuantities.cxx.

References MoqBase::LoadShower(), MoqBase::LoadTrack(), NtpSREventSummary::nshower, NtpSRShower::nstrip, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRPulseHeight::sigcor, NtpSRShower::stp, NtpSRRecord::stp, NtpSRShower::vtx, NtpSRTrack::vtx, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

00305                                          {
00306 
00307   //Try something a bit smarter:
00308   //Look for a reconstructed shower near to the track vtx and sum the SigCors
00309   if(!LoadTrack(itrk)) return 0.;
00310   
00311   Float_t Summed_Shw_SC = 0;
00312   Int_t bestshower = -1;
00313   Float_t bestdistance = 1000.;
00314   if(eventSummary->nshower!=0){
00315     for(Int_t i=0;i<eventSummary->nshower;i++){
00316       LoadShower(i);
00317       Float_t distance = sqrt((ntpTrack->vtx.x - ntpShower->vtx.x)
00318                               *(ntpTrack->vtx.x - ntpShower->vtx.x)
00319                               +(ntpTrack->vtx.y - ntpShower->vtx.y)
00320                               *(ntpTrack->vtx.y - ntpShower->vtx.y)
00321                               +(ntpTrack->vtx.z - ntpShower->vtx.z)
00322                               *(ntpTrack->vtx.z - ntpShower->vtx.z));
00323       
00324       if(distance<0.5){
00325         if(bestshower==-1) {
00326           bestshower = i;
00327           bestdistance = distance;
00328         }
00329         else if(distance<bestdistance) bestshower = i;
00330       }
00331     }
00332     
00333     TClonesArray& stripArray = *(record->stp);
00334     if(bestshower!=-1){
00335       LoadShower(bestshower);
00336       Int_t *shwstrips = ntpShower->stp;
00337       for(Int_t j=0;j<ntpShower->nstrip;j++){
00338         Int_t index = shwstrips[j];
00339         ntpStrip = dynamic_cast<NtpSRStrip *>(stripArray[index]);
00340         Summed_Shw_SC += ntpStrip->ph0.sigcor + ntpStrip->ph1.sigcor;
00341       }
00342       return Summed_Shw_SC;
00343     }
00344     return 0;
00345   }
00346   else return 0; //no reconstructed shower
00347 
00348 }

Float_t MoqQuantities::GetTrueShwSC Int_t  itr = 0  ) 
 

Definition at line 205 of file MoqQuantities.cxx.

References MoqBase::LoadTruth().

00205                                             {
00206 
00207   if(!LoadTruth(itr)) return 0.;
00208   
00209   Float_t Summed_Shw_SC = 0;
00210   
00211   return Summed_Shw_SC;
00212 }

Int_t MoqQuantities::IAction Int_t  itr = 0  ) 
 

Definition at line 126 of file MoqQuantities.cxx.

References NtpMCTruth::iaction, and MoqBase::LoadTruth().

00126                                      {
00127   if(!LoadTruth(itr)) return 0;
00128   return ntpTruth->iaction;
00129 }

Int_t MoqQuantities::INu Int_t  itr = 0  ) 
 

Definition at line 119 of file MoqQuantities.cxx.

References NtpMCTruth::inu, and MoqBase::LoadTruth().

00119                                  {
00120   if(!LoadTruth(itr)) return 0;
00121   return ntpTruth->inu;
00122 }

Int_t MoqQuantities::IResonance Int_t  itr = 0  ) 
 

Definition at line 133 of file MoqQuantities.cxx.

References NtpMCTruth::iresonance, and MoqBase::LoadTruth().

00133                                         {
00134   if(!LoadTruth(itr)) return 0;
00135   return ntpTruth->iresonance;
00136 }

Bool_t MoqQuantities::IsFidAll Int_t  itrk = 0  ) 
 

Definition at line 110 of file MoqQuantities.cxx.

References NtpSRFiducial::dr, NtpSRFiducial::dz, NtpSRTrack::fidall, and MoqBase::LoadTrack().

00110                                         {
00111   if(!LoadTrack(itrk)) return false;
00112   if(ntpTrack->fidall.dr<0.5||ntpTrack->fidall.dz<0.5) return false;
00113   return true;
00114 }

Bool_t MoqQuantities::IsSingleTrack  ) 
 

Definition at line 80 of file MoqQuantities.cxx.

References NtpSREventSummary::ntrack.

00080                                    {
00081   if(eventSummary->ntrack==1) return true;
00082   return false;
00083 }

Bool_t MoqQuantities::IsTrack  ) 
 

Definition at line 73 of file MoqQuantities.cxx.

References NtpSREventSummary::ntrack.

Referenced by PassTrackCuts().

00073                              {
00074   if(eventSummary->ntrack>0) return true;
00075   return false;
00076 }

void MoqQuantities::MakeHistoFile std::string   ) 
 

Definition at line 430 of file MoqQuantities.cxx.

References MoqBase::GetEntry(), PassCuts(), RecoMuEnergy(), RecoMuQP(), RecoShwEnergy(), TrueMuQP(), TrueNuEnergy(), and TrueShwEnergy().

00430                                               {
00431 
00432   std::string savename =  tag + ".ed.root";
00433   TFile save(savename.c_str(),"RECREATE"); 
00434   save.cd();
00435   
00436     //#declare lots of histos:
00437   TH1F *TrueEnergy = new TH1F("TrueEnergy","True Neutrino Energy",200,0,50);
00438 
00439   TH1F *RecoEnergy = new TH1F("RecoEnergy","Reco Neutrino Energy",200,0,50);
00440 
00441   TH1F *TrueMuEn = new TH1F("TrueMuEn","True Muon Energy",200,0,50);
00442 
00443   TH1F *RecoMuEn = new TH1F("RecoMuEn","Reco Muon Energy",200,0,50);
00444   
00445   TH1F *TrueShwEn = new TH1F("TrueShwEn","True Shower Energy",200,0,50);
00446 
00447   TH1F *RecoShwEn = new TH1F("RecoShwEn","Reco Shower Energy",200,0,50);
00448   
00449   TH1F *TrueMuQP = new TH1F("TrueMuQP","True Muon q/p",300,-3,3);
00450 
00451   TH1F *RecoMuQP = new TH1F("RecoMuQP","Reconstructed Muon q/p",300,-3,3);
00452   
00453   TH2F *TrueVsReco = new TH2F("TrueVsReco",
00454                               "Reco Vs True Neutrino Energy",
00455                               200,0,50,200,0,50);
00456 
00457   TH2F *TrueVsRecoMu = new TH2F("TrueVsRecoMu",
00458                                 "Reco Vs True Muon Energy",200,0,50,200,0,50);
00459 
00460   TH2F *TrueVsRecoShw = new TH2F("TrueVsRecoShw",
00461                                  "Reco Vs True Shower Energy",
00462                                  200,0,50,200,0,50);
00463   
00464   TH2F *TrueRecoDiff 
00465     = new TH2F("TrueRecoDiff",
00466                "(True - Reco)/True Neutrino Energy vs True Neutrino Energy",
00467                200,0,50,1000,-9,1);
00468 
00469   //  TH2F *TrueRecoDiffMuCurv 
00470   //  = new TH2F("TrueRecoDiffMuCurv",
00471   //       "(True - Reco_{Curv})/True Muon Energy vs True Muon Energy",
00472   //       200,0,50,1000,-9,1);
00473   
00474 
00475 
00476   TH2F *TrueRecoDiffShw 
00477     = new TH2F("TrueRecoDiffShw",
00478                "(True - Reco)/True Shower Energy vs True Shower Energy",
00479                200,0,50,1000,-9,1);
00480   
00481 
00482   //  TH2F *TrueCurvMu 
00483   //= new TH2F("TrueCurvMu",
00484   //       "Reco Muon Energy from Curvature vs True Muon Energy",
00485   //       200,0,50,200,0,50); 
00486 
00487 
00488   for(int i=0;i<Nentries;i++){
00489     
00490     if(i%1000==0) std::cout << float(i)*100./float(Nentries) 
00491                             << "% done" << std::endl;
00492 
00493     if(!GetEntry(i)) continue;
00494     
00495   
00496     
00497       if(this->PassCuts(0)){
00498           //neutrino
00499         TrueEnergy->Fill(this->TrueNuEnergy());
00500         RecoEnergy->Fill(this->RecoMuEnergy(1,0) + this->RecoShwEnergy());
00501         TrueVsReco->Fill(this->TrueNuEnergy(),this->RecoMuEnergy(1,0) 
00502                          + this->RecoShwEnergy());
00503         TrueRecoDiff->Fill(this->TrueNuEnergy(),
00504                            (this->TrueNuEnergy()-(this->RecoMuEnergy(1,0)
00505                                                   +this->RecoShwEnergy()))
00506                            /this->TrueNuEnergy());
00507         
00508 
00509         //shower          
00510         TrueShwEn->Fill(this->TrueShwEnergy());
00511         RecoShwEn->Fill(this->RecoShwEnergy());
00512         TrueVsRecoShw->Fill(this->TrueShwEnergy(),this->RecoShwEnergy());
00513         TrueRecoDiffShw->Fill(this->TrueShwEnergy(),
00514                               (this->TrueShwEnergy()
00515                                -this->RecoShwEnergy())
00516                               /this->TrueShwEnergy());
00517 
00518 
00519         //muon
00520         TrueMuEn->Fill(this->TrueMuEnergy());
00521         RecoMuEn->Fill(this->RecoMuEnergy(0,0));
00522         TrueVsRecoMu->Fill(this->TrueMuEnergy(),this->RecoMuEnergy(1,0));
00523         
00524         //curvature
00525         //TrueRecoDiffMuCurv->Fill(this->TrueMuEnergy(),
00526         //                       (this->TrueMuEnergy()
00527         //                -this->RecoMuEnergy(1,0))
00528         //               /this->TrueMuEnergy());
00529         //TrueCurvMu->Fill(this->TrueMuEnergy(),this->RecoMuEnergy(1,0));
00530         
00531         TrueMuQP->Fill(this->TrueMuQP());
00532         RecoMuQP->Fill(this->RecoMuQP(0));
00533         
00534       }
00535 
00536 
00537   }
00538 
00539  //#close file
00540   save.Write();
00541   save.Close();
00542 }

Bool_t MoqQuantities::PassCuts Int_t  itrk  ) 
 

Definition at line 99 of file MoqQuantities.cxx.

References PassTrackCuts().

Referenced by MakeHistoFile().

00099                                         {
00100   //basic fit track cuts:
00101   if(!PassTrackCuts(itrk)) return false;
00102   //check for contained vtx:
00103   //  if(ntpTrack->fidvtx.dr<0.5||ntpTrack->fidvtx.dz<0.5) return false;
00104   return true;
00105 }

Bool_t MoqQuantities::PassTrackCuts Int_t  itrk  ) 
 

Definition at line 87 of file MoqQuantities.cxx.

References NtpSRTrack::fit, IsTrack(), MoqBase::LoadTrack(), NtpSRTrack::momentum, NtpSREventSummary::nevent, NtpSRFitTrack::pass, and NtpSRMomentum::qp.

Referenced by PassCuts().

00087                                              {
00088   if(eventSummary->nevent!=1) return false; //is an event
00089   if(!IsTrack()) return false; //is a track
00090   LoadTrack(itrk); //load track
00091   if(ntpTrack->fit.pass==0) return false; //track fit passes
00092   if(ntpTrack->momentum.qp!=ntpTrack->momentum.qp) return false; //no nans
00093   if(fabs(ntpTrack->momentum.qp)<0.0005) return false; //no moms>2000
00094   return true;
00095 }

Float_t MoqQuantities::RecoMuEnergy Int_t  opt = 0,
Int_t  itrk = 0
 

Definition at line 239 of file MoqQuantities.cxx.

References NtpSRFiducial::dr, NtpSRFiducial::dz, NtpSRTrack::fidall, MoqBase::LoadTrack(), NtpSRTrack::momentum, NtpSRMomentum::qp, and NtpSRMomentum::range.

Referenced by MakeHistoFile(), and RecoQENuEnergy().

00239                                                        {
00240 
00241   if(LoadTrack(itrk)){
00242     if(opt==0){  //return the most appropriate measure of momentum
00243       if(ntpTrack->fidall.dr>0.5&&ntpTrack->fidall.dz>0.5) {
00244         return sqrt(ntpTrack->momentum.range*ntpTrack->momentum.range
00245                     + 0.10555*0.10555);
00246       }
00247       else {
00248         return sqrt(1./(ntpTrack->momentum.qp*ntpTrack->momentum.qp)
00249                     + 0.10555*0.10555);
00250       }
00251     }
00252     else if(opt==1) //return curvature measurement
00253       return sqrt(1./(ntpTrack->momentum.qp*ntpTrack->momentum.qp)
00254                   + 0.10555*0.10555);
00255     else if(opt==2) //return range measurement
00256       return sqrt(ntpTrack->momentum.range*ntpTrack->momentum.range
00257                   + 0.10555*0.10555);
00258     else return 0;
00259   }
00260   return 0.;
00261 }

Float_t MoqQuantities::RecoMuQP Int_t  itrk = 0  ) 
 

Definition at line 265 of file MoqQuantities.cxx.

References MoqBase::LoadTrack(), NtpSRTrack::momentum, and NtpSRMomentum::qp.

Referenced by GetChargeSign(), MakeHistoFile(), and VxB().

00265                                          {
00266   if(LoadTrack(itrk)) return ntpTrack->momentum.qp;
00267   return 0.;
00268 }

Float_t MoqQuantities::RecoQENuEnergy Int_t  itrk = 0  ) 
 

Definition at line 375 of file MoqQuantities.cxx.

References NtpSRVertex::dcosy, NtpSRVertex::dcosz, GetChargeSign(), MoqBase::LoadTrack(), RecoMuEnergy(), and NtpSRTrack::vtx.

00375                                                {
00376   
00377   if(!LoadTrack(itrk)) return 0.;
00378   Float_t nucleonMass = 0.93956563; //mass of neutron by default
00379   if(GetChargeSign(itrk)==1) nucleonMass = 0.93827231; //proton mass for nubar
00380   Float_t muonEnergy = RecoMuEnergy(0,itrk);
00381   Float_t muonMass = 0.10555;
00382   Float_t muonMomentum = sqrt(muonEnergy*muonEnergy - muonMass*muonMass);
00383   Float_t bl_z = TMath::Cos(TMath::Pi()*3./180.); //3degree beam
00384   Float_t bl_y = sqrt(1. - bl_z*bl_z);
00385   Float_t costhbl = ntpTrack->vtx.dcosz*bl_z + ntpTrack->vtx.dcosy*bl_y;
00386   
00387   return (nucleonMass*muonEnergy - muonMass*muonMass/2.)
00388     /(nucleonMass - muonEnergy + muonMomentum*costhbl);  
00389 
00390 }

Float_t MoqQuantities::RecoShwEnergy Int_t  opt = 0  ) 
 

Definition at line 352 of file MoqQuantities.cxx.

References NtpSRStripPulseHeight::gev, MoqBase::LoadShower(), and NtpSRShower::ph.

Referenced by MakeHistoFile().

00352                                              {
00353   
00354   Float_t theGeV = 0;
00355   //  if(opt==0) theGeV = GetShwSC(0)/10000.0; //MDC
00356   //else theGeV = GetNonTrkSC()/10000.0;
00357 
00358    // Return Jim's calculation
00359   if(LoadShower(opt)) theGeV=ntpShower->ph.gev;
00360   else theGeV=0.;
00361 
00362   return theGeV;
00363   
00364 }

Double_t MoqQuantities::SwimToGetVxB TVector3  ,
TVector3  ,
Int_t  ,
Double_t 
[protected]
 

Definition at line 415 of file MoqQuantities.cxx.

References done(), RecHeader::GetVldContext(), and SwimParticle::GetVxB().

Referenced by TrueVxB(), and VxB().

00416                                                          {
00417   
00418   SwimSwimmer ss(ntpHeader->GetVldContext());
00419   double muMass = 0.105658357*Munits::GeV;
00420   SwimParticle swimMu(pos,mom,muMass,chg);
00421   SwimZCondition zc(z);
00422   Bool_t done = ss.SwimForward(swimMu,zc);
00423   if(done) return swimMu.GetVxB();
00424 
00425   return swimMu.GetVxB(); //might not want to do this later
00426 
00427 }

Float_t MoqQuantities::TrueMuEnergy Int_t  itr = 0  ) 
 

Definition at line 178 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), and NtpMCTruth::p4mu1.

00178                                             {
00179   if(!LoadTruth(itr)) return 0;
00180   if(ntpTruth->p4mu1[3]!=0) return fabs(ntpTruth->p4mu1[3]);
00181   return 0;
00182 }

Float_t MoqQuantities::TrueMuQP Int_t  itr = 0  ) 
 

Definition at line 186 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), and NtpMCTruth::p4mu1.

Referenced by MakeHistoFile().

00186                                         {
00187   if(!LoadTruth(itr)) return 0;
00188   if(ntpTruth->p4mu1[3]!=0) {
00189     Float_t p = 1./sqrt(ntpTruth->p4mu1[3]*ntpTruth->p4mu1[3]-0.10555*0.10555);
00190     Float_t q = ntpTruth->p4mu1[3]/fabs(ntpTruth->p4mu1[3]);
00191     return q*p;
00192   }
00193   return 0;
00194 }

Float_t MoqQuantities::TrueNuEnergy Int_t  itr = 0  ) 
 

Definition at line 157 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), and NtpMCTruth::p4neu.

Referenced by MakeHistoFile().

00157                                             {
00158   if(!LoadTruth(itr)) return 0.;
00159   return ntpTruth->p4neu[3];
00160 }

Float_t MoqQuantities::TrueShwEnergy Int_t  itr = 0  ) 
 

Definition at line 198 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), and NtpMCTruth::p4shw.

Referenced by MakeHistoFile().

00198                                              {
00199   if(!LoadTruth(itr)) return 0.;
00200   return ntpTruth->p4shw[3];
00201 }

Float_t * MoqQuantities::TrueVtx Int_t  itr = 0  ) 
 

Definition at line 164 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), NtpMCTruth::vtxx, NtpMCTruth::vtxy, and NtpMCTruth::vtxz.

00164                                         {
00165   Float_t *vtx = new Float_t[3];  
00166   vtx[0] = 0.; 
00167   vtx[1] = 0.; 
00168   vtx[2] = 0.;
00169   if(!LoadTruth(itr)) return vtx;
00170   vtx[0] = ntpTruth->vtxx;
00171   vtx[1] = ntpTruth->vtxy;  
00172   vtx[2] = ntpTruth->vtxz;
00173   return vtx;
00174 }

Double_t MoqQuantities::TrueVxB Int_t  itr = 0  ) 
 

Definition at line 216 of file MoqQuantities.cxx.

References NtpSRTrack::end, MoqBase::LoadTruth(), NtpMCTruth::p4mu1, SwimToGetVxB(), NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, and NtpSRVertex::z.

00216                                         {
00217   
00218   if(!LoadTruth(itr)) return -1; //make sure there is an mc event
00219   if(ntpTruth->p4mu1[3]==0) return -1; //make sure there is a muon
00220   
00221   float truvtxu = ntpTruth->vtxx/sqrt(2.) + ntpTruth->vtxy/sqrt(2.);
00222   float truvtxv = - ntpTruth->vtxx/sqrt(2.) + ntpTruth->vtxy/sqrt(2.);
00223   float truvtxz = ntpTruth->vtxz;
00224   TVector3 trupos(truvtxu/100.,truvtxv/100.,truvtxz/100.);
00225   
00226   TVector3 trumom(ntpTruth->p4mu1[0]/sqrt(2.)+ntpTruth->p4mu1[1]/sqrt(2.),
00227                   -ntpTruth->p4mu1[0]/sqrt(2.)+ntpTruth->p4mu1[1]/sqrt(2.),
00228                   ntpTruth->p4mu1[2]);
00229 
00230   //assume that reco z is the same as true z for now:  
00231   return SwimToGetVxB(trupos,trumom,
00232                       int(ntpTruth->p4mu1[3]/fabs(ntpTruth->p4mu1[3])),
00233                       double(ntpTrack->end.z));
00234 }

Double_t MoqQuantities::VxB Int_t  itrk = 0  ) 
 

Definition at line 394 of file MoqQuantities.cxx.

References NtpSRVertex::dcosu, NtpSRVertex::dcosv, NtpSRVertex::dcosz, NtpSRTrack::end, GetChargeSign(), RecoMuQP(), SwimToGetVxB(), NtpSRVertex::u, NtpSRVertex::v, NtpSRTrack::vtx, and NtpSRVertex::z.

00394                                      {
00395   
00396   double mom = RecoMuQP(itrk); //this loads ntpTrack itrk
00397   if(fabs(mom)<0.0001) return -1;  //check for no track, q/p = 0
00398   mom = 1./fabs(mom);
00399   TVector3 position(ntpTrack->vtx.u,
00400                     ntpTrack->vtx.v,
00401                     ntpTrack->vtx.z);
00402   TVector3 momentum(mom*ntpTrack->vtx.dcosu,
00403                     mom*ntpTrack->vtx.dcosv,
00404                     mom*ntpTrack->vtx.dcosz);
00405   
00406   if(mom>0.05) return SwimToGetVxB(position,momentum,
00407                                    GetChargeSign(itrk),
00408                                    double(ntpTrack->end.z));
00409   return -1;
00410 
00411 }

Float_t MoqQuantities::W2 Int_t  itr = 0  ) 
 

Definition at line 150 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), and NtpMCTruth::w2.

00150                                   {
00151   if(!LoadTruth(itr)) return 0;
00152   return ntpTruth->w2;
00153 }

Float_t MoqQuantities::Y Int_t  itr = 0  ) 
 

Definition at line 143 of file MoqQuantities.cxx.

References MoqBase::LoadTruth(), and NtpMCTruth::y.

00143                                  {
00144   if(!LoadTruth(itr)) return 0;
00145   return ntpTruth->y;
00146 }


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:37 2010 for loon by  doxygen 1.3.9.1