MuonRemovalInfoAna Class Reference

#include <MuonRemovalInfoAna.h>

Inheritance diagram for MuonRemovalInfoAna:
NueAnaBase

List of all members.

Public Member Functions

 MuonRemovalInfoAna (MuonRemovalInfo &sv)
virtual ~MuonRemovalInfoAna ()
void Analyze (int evtn, RecRecordImp< RecCandHeader > *mrobj)
void Analyze (int evtn, RecRecordImp< RecCandHeader > *mrobj, RecRecordImp< RecCandHeader > *oldstobj)
void Analyze (int evtn, NtpMRRecord *mrobj, NtpStRecord *oldstobj)
float LoadROPID (int evtn)

Private Attributes

MuonRemovalInfofMuonRemovalInfo

Static Private Attributes

static MadDpID dpid
static MadNsID nsid
static MadAbID abid
static bool readabidfile = false

Detailed Description

Definition at line 15 of file MuonRemovalInfoAna.h.


Constructor & Destructor Documentation

MuonRemovalInfoAna::MuonRemovalInfoAna ( MuonRemovalInfo sv  ) 

Definition at line 35 of file MuonRemovalInfoAna.cxx.

00035                                                           :
00036   fMuonRemovalInfo(mri)
00037 {}

MuonRemovalInfoAna::~MuonRemovalInfoAna (  )  [virtual]

Definition at line 39 of file MuonRemovalInfoAna.cxx.

00040 {}


Member Function Documentation

void MuonRemovalInfoAna::Analyze ( int  evtn,
NtpMRRecord mrobj,
NtpStRecord oldstobj 
)

Definition at line 62 of file MuonRemovalInfoAna.cxx.

References MuELoss::a, abid, bfld::AsString(), ReleaseType::AsString(), MuonRemovalInfo::azimuth, NtpMREvent::azimuth, base, NueAnaBase::beam, NtpSRPlane::beg, NtpMREvent::best_complete, MuonRemovalInfo::best_complete, NtpMREvent::best_complete_phw, MuonRemovalInfo::best_complete_phw, NtpMREvent::best_event, NtpMREvent::best_purity, MuonRemovalInfo::best_purity, NtpMREvent::best_purity_phw, MuonRemovalInfo::best_purity_phw, MadDpID::CalcPID(), MadAbID::CalcPID(), MadDpID::ChoosePDFs(), MadNsID::ChooseWeightFile(), NtpTHEvent::completeall, dpid, MuonRemovalInfo::elec_complete, NtpMREvent::elec_complete, MuonRemovalInfo::elec_complete_phw, NtpMREvent::elec_complete_phw, NtpSRPlane::end, NtpSRTrack::end, NtpMREvent::endc, MuonRemovalInfo::endc, MuonRemovalInfo::enddistance, NtpMREvent::enddistance, NtpMREvent::endp, MuonRemovalInfo::endp, NtpMREvent::endx, MuonRemovalInfo::endx, NtpMREvent::endy, MuonRemovalInfo::endy, NtpMREvent::endz, MuonRemovalInfo::endz, NtpSRMomentum::eqp, NtpStRecord::evthdr, MuonRemovalInfo::fitp, NtpMREvent::fitp, fMuonRemovalInfo, fname, EnergyCorrections::FullyCorrectMomentumFromRange(), EnergyCorrections::FullyCorrectShowerEnergy(), EnergyCorrections::FullyCorrectSignedMomentumFromCurvature(), VldContext::GetDetector(), SntpHelpers::GetEvent(), RecRecordImp< T >::GetHeader(), SntpHelpers::GetMREvent(), SntpHelpers::GetMRTruth(), MadNsID::GetPID(), AtNuAnaUtil::GetPrimaryShower(), VldContext::GetSimFlag(), SntpHelpers::GetTrack(), RecHeader::GetVldContext(), gSystem(), ReleaseType::IsBirch(), ReleaseType::IsCarrot(), ReleaseType::IsCedar(), ANtpDefaultValue::IsDefault(), ReleaseType::IsDogwood(), EnergyCorrections::kBirch, CandShowerHandle::kCC, EnergyCorrections::kCedar, EnergyCorrections::kDefault, EnergyCorrections::kDogwood, Msg::kError, Detector::kFar, Msg::kFatal, ANtpDefaultValue::kFloat, BeamType::kL010z000i, BeamType::kL010z170i, BeamType::kL010z185i, BeamType::kL010z200i, BeamType::kL100z200i, BeamType::kL150z200i, BeamType::kL250z200i, BeamType::kLE, SimFlag::kMC, Detector::kNear, Msg::kWarning, NtpSRShowerPulseHeight::linCCgev, LoadROPID(), MAXMSG, NtpSRTrack::momentum, NtpMRRecord::mrhdr, MuonRemovalInfo::mrmEshw, NtpMREvent::mrmEshw, NtpMREvent::mrmpmux, MuonRemovalInfo::mrmpmux, NtpMREvent::mrmpmuy, MuonRemovalInfo::mrmpmuy, NtpMREvent::mrmpmuz, MuonRemovalInfo::mrmpmuz, MuonRemovalInfo::mrmQ2, NtpMREvent::mrmQ2, MSG, NtpMREvent::mxpl, MuonRemovalInfo::mxpl, NtpSRPlane::n, NtpMREvent::ndigit, MuonRemovalInfo::ndigit, NtpMRSummary::nmrevt, NtpMRTruth::nMuonDig, MuonRemovalInfo::nMuonDig, NtpMRTruth::nMuonDigRetained, MuonRemovalInfo::nMuonDigRetained, NtpMRTruth::nPERetained, MuonRemovalInfo::nPERetained, MuonRemovalInfo::nPERetainedBoth, NtpMRTruth::nPERetainedBoth, NtpMRTruth::nPERetainedMuon, MuonRemovalInfo::nPERetainedMuon, MuonRemovalInfo::nPERetainedShw, NtpMRTruth::nPERetainedShw, NtpMREvent::npln, MuonRemovalInfo::npln, NtpMRTruth::nRejected, MuonRemovalInfo::nRejected, NtpMRTruth::nRejectedBoth, MuonRemovalInfo::nRejectedBoth, NtpMRTruth::nRejectedMuon, MuonRemovalInfo::nRejectedMuon, NtpMRTruth::nRejectedShw, MuonRemovalInfo::nRejectedShw, NtpMRTruth::nRejShw, MuonRemovalInfo::nRejShw, MuonRemovalInfo::nRejShwFakeTrk, NtpMRTruth::nRejShwFakeTrk, NtpMRTruth::nRejShwMaxTrk, MuonRemovalInfo::nRejShwMaxTrk, NtpMRTruth::nRejShwMix, MuonRemovalInfo::nRejShwMix, MuonRemovalInfo::nRetained, NtpMRTruth::nRetained, NtpMRTruth::nRetainedBoth, MuonRemovalInfo::nRetainedBoth, NtpMRTruth::nRetainedMuon, MuonRemovalInfo::nRetainedMuon, NtpMRTruth::nRetainedShw, MuonRemovalInfo::nRetainedShw, MuonRemovalInfo::nrmstp, NtpSREvent::nshower, NtpMRTruth::nShwDig, MuonRemovalInfo::nShwDig, NtpMRTruth::nShwDigAtVtx, MuonRemovalInfo::nShwDigAtVtx, MuonRemovalInfo::nShwDigRetained, NtpMRTruth::nShwDigRetained, MuonRemovalInfo::nShwDigRetainedAtVtx, NtpMRTruth::nShwDigRetainedAtVtx, NtpMRTruth::nShwPE, MuonRemovalInfo::nShwPE, NtpMRTruth::nShwPEAtVtx, MuonRemovalInfo::nShwPEAtVtx, NtpMRTruth::nShwPERetained, MuonRemovalInfo::nShwPERetained, MuonRemovalInfo::nShwPERetainedAtVtx, NtpMRTruth::nShwPERetainedAtVtx, nsid, NtpSRShower::nstpcnt, NtpSREvent::nstrip, MuonRemovalInfo::nstrip, NtpMREvent::nstrip, NtpSREvent::ntrack, MuonRemovalInfo::orig_abCCPID, MuonRemovalInfo::orig_cc_pid, MuonRemovalInfo::orig_event, NtpMREvent::orig_event, MuonRemovalInfo::orig_evt_complete, MuonRemovalInfo::orig_evt_purity, MuonRemovalInfo::orig_nsCCPID, MuonRemovalInfo::orig_roCCPID, MuonRemovalInfo::origShwBegPlane, MuonRemovalInfo::origShwEndPlane, MuonRemovalInfo::origShwPlanes, MuonRemovalInfo::origShwStrips, MuonRemovalInfo::origShwVtxPlane, MuonRemovalInfo::origShwVtxX, MuonRemovalInfo::origShwVtxY, MuonRemovalInfo::origShwVtxZ, MuonRemovalInfo::pass, NtpMREvent::pass, MuonRemovalInfo::pcrv, NtpMREvent::pcrv, NtpSRShower::plane, NtpSRVertex::plane, MuonRemovalInfo::pmux, NtpMREvent::pmux, MuonRemovalInfo::pmuy, NtpMREvent::pmuy, MuonRemovalInfo::pmuz, NtpMREvent::pmuz, MuonRemovalInfo::prng, NtpMREvent::prng, NtpTHEvent::purity, MuonRemovalInfo::pvdx, NtpMREvent::pvdx, MuonRemovalInfo::pvdy, NtpMREvent::pvdy, NtpMREvent::pvdz, MuonRemovalInfo::pvdz, MuonRemovalInfo::qp, NtpSRMomentum::qp, readabidfile, MadAbID::ReadPDFs(), NueAnaBase::release, MuonRemovalInfo::Reset(), EnergyCorrections::SetCorrectionVersion(), MadDpID::SetPHCorrection(), MuonRemovalInfo::shwe, NtpSRShower::shwph, MuonRemovalInfo::SigmaQP, NtpSREvent::stp, NtpMREvent::stp, NtpStRecord::thevt, NtpSREvent::trk, NtpSRVertex::u, NtpSRVertex::v, NtpSRShower::vtx, MuonRemovalInfo::vtxdistance, NtpMREvent::vtxdistance, MuonRemovalInfo::vtxp, NtpMREvent::vtxp, MuonRemovalInfo::vtxx, NtpMREvent::vtxx, MuonRemovalInfo::vtxy, NtpMREvent::vtxy, MuonRemovalInfo::vtxz, NtpMREvent::vtxz, NtpSRVertex::x, NtpSRVertex::y, NtpSRVertex::z, NtpMREvent::zenith, and MuonRemovalInfo::zenith.

00064 {
00065   fMuonRemovalInfo.Reset();
00066   if(mrobj==0){
00067     return;
00068   }
00069 
00070   if(ReleaseType::IsDogwood(release))
00071      SetCorrectionVersion(EnergyCorrections::kDogwood);
00072   if(ReleaseType::IsCedar(release))
00073      SetCorrectionVersion(EnergyCorrections::kCedar);
00074   if(ReleaseType::IsBirch(release))
00075      SetCorrectionVersion(EnergyCorrections::kBirch);
00076   
00077   //find the best matching rmmu entry for this event
00078   Int_t best_rmmu = -1;
00079   Float_t best_com = 0;
00080   for(int i=0;i<mrobj->mrhdr.nmrevt;i++){
00081     NtpMREvent *ev = SntpHelpers::GetMREvent(i,mrobj);
00082     if(ev && ev->best_event==evtn && ev->best_complete>best_com) {
00083       best_com = ev->best_complete;
00084       best_rmmu = i;
00085     }
00086   }
00087   if(best_rmmu<0) return;
00088   
00089   NtpMREvent *ev = SntpHelpers::GetMREvent(best_rmmu,mrobj);
00090   NtpMRTruth *tru = SntpHelpers::GetMRTruth(best_rmmu,mrobj);
00091 
00092   if(!ev) return;
00093 
00094   VldContext vc = mrobj->GetHeader().GetVldContext();
00095   double rangemom = ev->prng;
00096   double curvemom = ev->pcrv;
00097   EnergyCorrections::WhichCorrection_t corrver = EnergyCorrections::kDefault;
00098   
00099 
00100   if(rangemom>0) rangemom=FullyCorrectMomentumFromRange(rangemom,vc,release,corrver);
00101   curvemom =    FullyCorrectSignedMomentumFromCurvature(curvemom,vc,release,corrver);
00102 
00103   fMuonRemovalInfo.ndigit = ev->ndigit;
00104   fMuonRemovalInfo.nstrip = ev->nstrip;
00105   fMuonRemovalInfo.orig_event = ev->orig_event;
00106   fMuonRemovalInfo.best_purity = ev->best_purity;
00107   fMuonRemovalInfo.best_complete = ev->best_complete;
00108   fMuonRemovalInfo.elec_complete = ev->elec_complete;
00109   fMuonRemovalInfo.best_purity_phw = ev->best_purity_phw;
00110   fMuonRemovalInfo.best_complete_phw = ev->best_complete_phw;
00111   fMuonRemovalInfo.elec_complete_phw = ev->elec_complete_phw;
00112   fMuonRemovalInfo.vtxx = ev->vtxx;
00113   fMuonRemovalInfo.vtxy = ev->vtxy;
00114   fMuonRemovalInfo.vtxz = ev->vtxz;
00115   fMuonRemovalInfo.vtxp = ev->vtxp;
00116   fMuonRemovalInfo.npln = ev->npln;
00117   fMuonRemovalInfo.prng = rangemom;
00118   fMuonRemovalInfo.pcrv = curvemom;
00119   fMuonRemovalInfo.pvdx = ev->pvdx;
00120   fMuonRemovalInfo.pvdy = ev->pvdy;
00121   fMuonRemovalInfo.pvdz = ev->pvdz;
00122   fMuonRemovalInfo.fitp = ev->fitp;
00123   fMuonRemovalInfo.endc = ev->endc; 
00124   fMuonRemovalInfo.pass = ev->pass;
00125   fMuonRemovalInfo.pmux = ev->pmux;
00126   fMuonRemovalInfo.pmuy = ev->pmuy;
00127   fMuonRemovalInfo.pmuz = ev->pmuz;
00128   fMuonRemovalInfo.mxpl = ev->mxpl;
00129   fMuonRemovalInfo.vtxdistance = ev->vtxdistance;
00130   fMuonRemovalInfo.endx = ev->endx;
00131   fMuonRemovalInfo.endy = ev->endy;
00132   fMuonRemovalInfo.endz = ev->endz;
00133   fMuonRemovalInfo.enddistance = ev->enddistance;
00134   fMuonRemovalInfo.endp = ev->endp;
00135   fMuonRemovalInfo.zenith = ev->zenith;
00136   fMuonRemovalInfo.azimuth = ev->azimuth;
00137   fMuonRemovalInfo.mrmpmux = ev->mrmpmux;
00138   fMuonRemovalInfo.mrmpmuy = ev->mrmpmuy;
00139   fMuonRemovalInfo.mrmpmuz = ev->mrmpmuz;
00140   fMuonRemovalInfo.mrmQ2   = ev->mrmQ2;
00141   fMuonRemovalInfo.mrmEshw = ev->mrmEshw;
00142  
00143   if(tru) {
00144     fMuonRemovalInfo.nMuonDig = tru->nMuonDig;
00145     fMuonRemovalInfo.nMuonDigRetained = tru->nMuonDigRetained;
00146     fMuonRemovalInfo.nShwDig = tru->nShwDig;
00147     fMuonRemovalInfo.nShwDigRetained = tru->nShwDigRetained;
00148     fMuonRemovalInfo.nShwDigAtVtx = tru->nShwDigAtVtx;
00149     fMuonRemovalInfo.nShwDigRetainedAtVtx = tru->nShwDigRetainedAtVtx;
00150     fMuonRemovalInfo.nShwPE = tru->nShwPE;
00151     fMuonRemovalInfo.nShwPERetained = tru->nShwPERetained;
00152     fMuonRemovalInfo.nShwPEAtVtx = tru->nShwPEAtVtx;
00153     fMuonRemovalInfo.nShwPERetainedAtVtx = tru->nShwPERetainedAtVtx;
00154     fMuonRemovalInfo.nRetained = tru->nRetained;
00155     fMuonRemovalInfo.nRetainedMuon = tru->nRetainedMuon;
00156     fMuonRemovalInfo.nRetainedShw = tru->nRetainedShw;
00157     fMuonRemovalInfo.nRetainedBoth = tru->nRetainedBoth;
00158     fMuonRemovalInfo.nPERetained = tru->nPERetained;
00159     fMuonRemovalInfo.nPERetainedMuon = tru->nPERetainedMuon;
00160     fMuonRemovalInfo.nPERetainedShw = tru->nPERetainedShw;
00161     fMuonRemovalInfo.nPERetainedBoth = tru->nPERetainedBoth;
00162     fMuonRemovalInfo.nRejected = tru->nRejected;
00163     fMuonRemovalInfo.nRejectedMuon = tru->nRejectedMuon;
00164     fMuonRemovalInfo.nRejectedShw = tru->nRejectedShw;
00165     fMuonRemovalInfo.nRejectedBoth = tru->nRejectedBoth;
00166     fMuonRemovalInfo.nRejShw = tru->nRejShw;
00167     fMuonRemovalInfo.nRejShwMaxTrk = tru->nRejShwMaxTrk;
00168     fMuonRemovalInfo.nRejShwFakeTrk = tru->nRejShwFakeTrk;
00169     fMuonRemovalInfo.nRejShwMix = tru->nRejShwMix;
00170   }
00171 
00172   //check if an NtpOldRecord was passed
00173   if(oldstobj==0){
00174     return;
00175   }
00176 
00177   NtpSREventSummary *evtSum = &(oldstobj->evthdr);
00178   NtpSREvent *oldevt = SntpHelpers::GetEvent(ev->orig_event,oldstobj);
00179   if(oldevt == 0){
00180       MAXMSG("MuonRemovalAna",Msg::kError,10)<<"Original event ("<<ev->orig_event
00181           <<") isn't here ("<<evtn<<")anymore, that is odd\n"
00182           <<" Lost event had comp/pur "
00183           <<ev->best_purity_phw<<"  "<<ev->best_complete_phw<<endl;
00184     return;
00185   }
00186 
00187   NtpSRTrack *oldtrk = 0;
00188   NtpSRShower *oldshw = 0;
00189   if(oldevt->ntrack>0)  oldtrk = SntpHelpers::GetTrack(oldevt->trk[0],oldstobj);
00190   if(oldevt->nshower>0) oldshw = SntpHelpers::GetPrimaryShower(ev->orig_event,oldstobj);
00191   
00192   Detector::Detector_t detType = 
00193     oldstobj->GetHeader().GetVldContext().GetDetector();
00194   if(detType==Detector::kFar) dpid.SetPHCorrection(1.018);
00195   Detector::Detector_t fDetectorType = detType;
00196  
00197 
00198   string reco_version = ReleaseType::AsString(release); 
00199   string mc_version = ""; 
00200   if(mrobj->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kMC) 
00201     mc_version = ReleaseType::AsString(release); 
00202   if(ReleaseType::IsCarrot(release)) reco_version = "birch"; 
00203   else if(ReleaseType::IsCedar(release)) reco_version = "cedar"; 
00204   else if(ReleaseType::IsDogwood(release)) reco_version = "cedar";  //<-- ! no dogwood file! 
00205   else reco_version = "birch"; 
00206 
00207   BeamType::BeamType_t current_beam = beam;
00208 
00209   if(dpid.ChoosePDFs(detType,BeamType::kLE,
00210                      reco_version,mc_version))
00211     fMuonRemovalInfo.orig_cc_pid = 
00212       dpid.CalcPID(oldtrk,oldevt,evtSum,detType,0);
00213  
00214   if(nsid.ChooseWeightFile(detType,current_beam)){
00215     if(!nsid.GetPID(oldevt,oldtrk,oldshw,oldstobj,detType,fMuonRemovalInfo.orig_nsCCPID))
00216        fMuonRemovalInfo.orig_nsCCPID=ANtpDefVal::kFloat;
00217   }
00218 
00219   if(!readabidfile){
00220     string base=getenv("SRT_PRIVATE_CONTEXT");
00221     if(base!=""&&base!="."){
00222       // check if directory exists in SRT_PRIVATE_CONTEXT
00223       std::string path = base + "/Mad/data";
00224       void *dir_ptr = gSystem -> OpenDirectory(path.c_str());
00225       if(!dir_ptr){
00226         base=getenv("SRT_PUBLIC_CONTEXT");
00227       }
00228     }
00229     else{  base=getenv("SRT_PUBLIC_CONTEXT"); }
00230     if(base=="") {
00231       MSG("AnalysisInfoAna",Msg::kFatal)<<"No SRT_PUBLIC_CONTEXT set "
00232                                         <<"Do not know where to look "
00233                                         <<"for AB pdf files "<<std::endl;
00234       assert(false);
00235     }
00236     base+="/Mad/data";
00237     string fname=base;
00238     string rmc="";
00239     if(ReleaseType::IsCedar(release)&&mc_version=="daikon"){
00240       rmc="cedar_daikon";
00241     }
00242     else{
00243       MSG("AnalysisInfoAna",Msg::kWarning)<<"Dont know reco/mc versions "
00244                                           <<"defaulting to cedar_daikon"<<endl;
00245       rmc="cedar_daikon";
00246     }
00247     string sdet="";
00248     if(fDetectorType==Detector::kNear){
00249       sdet="near";
00250     }
00251     else if(fDetectorType==Detector::kFar){
00252       sdet="far";
00253     }
00254     else{
00255       MSG("AnalysisInfoAna",Msg::kWarning)<<"Dont know detector type "
00256                                           <<"defaulting to far"<<endl;
00257       sdet="far";
00258     }
00259     string sbeam="";
00260     switch (current_beam){
00261     case BeamType::kL010z000i:
00262       sbeam="le0";
00263       break;
00264     case BeamType::kL010z170i:
00265       sbeam="le170";
00266       break;
00267     case BeamType::kL010z185i:
00268       sbeam="le";
00269       break;
00270     case BeamType::kL010z200i:
00271       sbeam="le200";
00272       break;
00273     case BeamType::kL100z200i:
00274       sbeam="pme";
00275       break;
00276     case BeamType::kL150z200i:
00277       sbeam="pme";
00278       break;
00279     case BeamType::kL250z200i:
00280       sbeam="phe";
00281       break;
00282     case BeamType::kLE:
00283       sbeam="le";
00284       break;
00285     default:
00286       MSG("AnalysisInfoAna",Msg::kWarning)<<"Don't know beam type "
00287                                          <<" defaulting to LE"<<endl;
00288       sbeam="le";
00289       break;
00290     }
00291                                                                                 
00292     fname+="/ab_pdf_"+sdet+"_"+sbeam+"_"+rmc+".root";
00293                                                                                 
00294     abid.ReadPDFs(fname.c_str());
00295     readabidfile=true;
00296   }
00297                                                                                 
00298   fMuonRemovalInfo.orig_abCCPID=abid.CalcPID(oldevt,oldstobj);
00299   fMuonRemovalInfo.orig_roCCPID=LoadROPID(ev->orig_event);
00300   
00301   
00302 
00304   // This block of code is to fix a bug in the original 
00305   // MuonRemoval/SelectEvent/TrackEndContained function
00306   // It will recalculate the muon momentum based on the 
00307   // track end containment. As of 17/11/06 these cuts are
00308   // the same as those in MuonRemoval
00309   if(oldtrk) {    
00310 
00311     fMuonRemovalInfo.qp = oldtrk->momentum.qp;
00312     fMuonRemovalInfo.SigmaQP = oldtrk->momentum.eqp;
00313 
00314     if(detType==Detector::kFar) {
00315       if(oldtrk->end.plane<=475 &&
00316          TMath::Power(oldtrk->end.x,2) + 
00317          TMath::Power(oldtrk->end.y,2) <= 12.25){
00318         fMuonRemovalInfo.endc = true;
00319         fMuonRemovalInfo.pmux = fMuonRemovalInfo.pvdx*fMuonRemovalInfo.prng;
00320         fMuonRemovalInfo.pmuy = fMuonRemovalInfo.pvdy*fMuonRemovalInfo.prng;
00321         fMuonRemovalInfo.pmuz = fMuonRemovalInfo.pvdz*fMuonRemovalInfo.prng;
00322       }
00323       else {
00324         fMuonRemovalInfo.endc = false;
00325         if(fMuonRemovalInfo.fitp==1){
00326           fMuonRemovalInfo.pmux = fMuonRemovalInfo.pvdx*fMuonRemovalInfo.pcrv;
00327           fMuonRemovalInfo.pmuy = fMuonRemovalInfo.pvdy*fMuonRemovalInfo.pcrv;
00328           fMuonRemovalInfo.pmuz = fMuonRemovalInfo.pvdz*fMuonRemovalInfo.pcrv;
00329         }
00330         else {
00331           fMuonRemovalInfo.pmux = fMuonRemovalInfo.pvdx*fMuonRemovalInfo.prng;
00332           fMuonRemovalInfo.pmuy = fMuonRemovalInfo.pvdy*fMuonRemovalInfo.prng;
00333           fMuonRemovalInfo.pmuz = fMuonRemovalInfo.pvdz*fMuonRemovalInfo.prng;
00334         }
00335       }
00336     }
00337     else if(detType==Detector::kNear) {
00338       //pitt fiducial volume for ND
00339       Float_t trk_x  = oldtrk->end.x;
00340       Float_t trk_y  = oldtrk->end.y;
00341       Float_t trk_u  = oldtrk->end.u;
00342       Float_t trk_v  = oldtrk->end.v;
00343       Float_t trk_z  = oldtrk->end.z;
00344       Float_t trk_r2 = trk_x*trk_x + trk_y*trk_y;
00345       Bool_t endc = false;
00346       if(trk_z<7.0) {
00347         if( trk_u>0.3 && trk_u<1.8 && trk_v>-1.8 && trk_v<-0.3 && 
00348             trk_x<2.4 && trk_r2>0.8*0.8 ) endc = true;
00349         else endc = false;
00350       }
00351       else{
00352         static const Float_t coil_cut=0.8*0.8;
00353         static const Float_t x0=0.8;
00354         static const Float_t y0=0.0;
00355         static const Float_t a=1.7;
00356         static const Float_t b=1.4;
00357         const Float_t xsc = (trk_x-x0)/a; // rescale ellipse to unit circle
00358         const Float_t ysc = (trk_y-y0)/b;
00359         if( (sqrt(xsc*xsc + ysc*ysc)<1.0) && 
00360             (trk_r2>coil_cut) && (trk_z<15.6) ) endc = true;
00361         else endc = false;
00362       }
00363       
00364       if(endc){
00365         fMuonRemovalInfo.endc = true;
00366         fMuonRemovalInfo.pmux = fMuonRemovalInfo.pvdx*fMuonRemovalInfo.prng;
00367         fMuonRemovalInfo.pmuy = fMuonRemovalInfo.pvdy*fMuonRemovalInfo.prng;
00368         fMuonRemovalInfo.pmuz = fMuonRemovalInfo.pvdz*fMuonRemovalInfo.prng;
00369       }
00370       else {
00371         fMuonRemovalInfo.endc = false;
00372         if(fMuonRemovalInfo.fitp==1){
00373           fMuonRemovalInfo.pmux = fMuonRemovalInfo.pvdx*fMuonRemovalInfo.pcrv;
00374           fMuonRemovalInfo.pmuy = fMuonRemovalInfo.pvdy*fMuonRemovalInfo.pcrv;
00375           fMuonRemovalInfo.pmuz = fMuonRemovalInfo.pvdz*fMuonRemovalInfo.pcrv;
00376         }
00377         else {
00378           fMuonRemovalInfo.pmux = fMuonRemovalInfo.pvdx*fMuonRemovalInfo.prng;
00379           fMuonRemovalInfo.pmuy = fMuonRemovalInfo.pvdy*fMuonRemovalInfo.prng;
00380           fMuonRemovalInfo.pmuz = fMuonRemovalInfo.pvdz*fMuonRemovalInfo.prng;
00381         }
00382       }
00383     }
00384   }
00386   
00387   if(oldshw){
00388     if(!ANtpDefVal::IsDefault(oldshw->shwph.linCCgev)){
00389         fMuonRemovalInfo.shwe = FullyCorrectShowerEnergy(oldshw->shwph.linCCgev,
00390                                    CandShowerHandle::kCC,vc,release,EnergyCorrections::kDefault);
00391     fMuonRemovalInfo.origShwPlanes = oldshw->plane.n;
00392     fMuonRemovalInfo.origShwBegPlane = oldshw->plane.beg;
00393     fMuonRemovalInfo.origShwEndPlane = oldshw->plane.end;
00394     fMuonRemovalInfo.origShwStrips = oldshw->nstpcnt;
00395     fMuonRemovalInfo.origShwVtxPlane = oldshw->vtx.plane;
00396     fMuonRemovalInfo.origShwVtxX = oldshw->vtx.x;
00397     fMuonRemovalInfo.origShwVtxY = oldshw->vtx.y;
00398     fMuonRemovalInfo.origShwVtxZ = oldshw->vtx.z;
00399     }
00400     else {
00401     fMuonRemovalInfo.shwe = 0;
00402     fMuonRemovalInfo.origShwPlanes = 0;
00403     fMuonRemovalInfo.origShwBegPlane = 0;
00404     fMuonRemovalInfo.origShwEndPlane = 0;
00405     fMuonRemovalInfo.origShwStrips = 0;
00406     fMuonRemovalInfo.origShwVtxPlane = 0;
00407     fMuonRemovalInfo.origShwVtxX = 0;
00408     fMuonRemovalInfo.origShwVtxY = 0;
00409     fMuonRemovalInfo.origShwVtxZ = 0;
00410     }
00411   }
00412   else {
00413     fMuonRemovalInfo.shwe = 0;
00414     fMuonRemovalInfo.origShwPlanes = 0;
00415     fMuonRemovalInfo.origShwBegPlane = 0;
00416     fMuonRemovalInfo.origShwEndPlane = 0;
00417     fMuonRemovalInfo.origShwStrips = 0;
00418     fMuonRemovalInfo.origShwVtxPlane = 0;
00419     fMuonRemovalInfo.origShwVtxX = 0;
00420     fMuonRemovalInfo.origShwVtxY = 0;
00421     fMuonRemovalInfo.origShwVtxZ = 0;
00422 
00423   }
00424   fMuonRemovalInfo.nrmstp = oldevt->nstrip;
00425   for(int i=0;i<ev->nstrip;i++){
00426     for(int j=0;j<oldevt->nstrip;j++){
00427       if(ev->stp[i]==oldevt->stp[j]) {
00428         fMuonRemovalInfo.nrmstp -= 1;
00429         break;
00430       }
00431     }
00432   }
00433 
00434   if(oldstobj->GetHeader().GetVldContext().GetSimFlag()==4){
00435     NtpTHEvent *oldthev = 
00436       dynamic_cast<NtpTHEvent *>((*oldstobj->thevt)[ev->orig_event]);
00437     if(oldthev) {
00438       fMuonRemovalInfo.orig_evt_purity   = oldthev->purity;
00439       fMuonRemovalInfo.orig_evt_complete = oldthev->completeall;
00440     }
00441   }
00442 
00443 }

void MuonRemovalInfoAna::Analyze ( int  evtn,
RecRecordImp< RecCandHeader > *  mrobj,
RecRecordImp< RecCandHeader > *  oldstobj 
)

Definition at line 51 of file MuonRemovalInfoAna.cxx.

References Analyze().

00053 {
00054   if(mrobj==0){
00055     return;
00056   }
00057   NtpMRRecord *mr = dynamic_cast<NtpMRRecord *>(mrobj);
00058   NtpStRecord *oldst = dynamic_cast<NtpStRecord *>(oldstobj);
00059   Analyze(event,mr,oldst);
00060 }

void MuonRemovalInfoAna::Analyze ( int  evtn,
RecRecordImp< RecCandHeader > *  mrobj 
) [virtual]

Implements NueAnaBase.

Definition at line 42 of file MuonRemovalInfoAna.cxx.

Referenced by Analyze(), and NueRecordAna::Analyze().

00043 {
00044   if(mrobj==0){
00045     return;
00046   }
00047   NtpMRRecord *mr = dynamic_cast<NtpMRRecord *>(mrobj);
00048   Analyze(event,mr,0);
00049 }

float MuonRemovalInfoAna::LoadROPID ( int  evtn  ) 

Definition at line 446 of file MuonRemovalInfoAna.cxx.

References Msg::kError, ANtpDefaultValue::kFloat, MAXMSG, and Anp::Handle< T >::valid().

Referenced by Analyze().

00446                                            {
00447 
00448 //   vector<string> list =  Anp::Factory<StorekNNData>::Instance().List();
00449 //   cout<<list.size()<<endl;
00450  
00451    //Loading up Rustems variables
00452    Anp::Handle<StorekNNData> data = Anp::Factory<StorekNNData>::Instance().Get("kNNData");
00453    if(!data.valid())
00454    {
00455       MAXMSG("NueModule", Msg::kError, 1)
00456           << "NueModule::Reco - Handle<StorekNNData> is invalid, assuming no Rustem variable to run"
00457           << endl;
00458       return ANtpDefVal::kFloat;
00459    }
00460 
00461    float knn_pid;
00462 
00463    data -> SetPrefix("OldSNTP");
00464    data -> Get(evtn, "knn_pid", knn_pid);
00465    return knn_pid;
00466 }                                                                              


Member Data Documentation

MadAbID MuonRemovalInfoAna::abid [static, private]

Definition at line 35 of file MuonRemovalInfoAna.h.

Referenced by Analyze().

MadDpID MuonRemovalInfoAna::dpid [static, private]

Definition at line 33 of file MuonRemovalInfoAna.h.

Referenced by Analyze().

Definition at line 31 of file MuonRemovalInfoAna.h.

Referenced by Analyze().

MadNsID MuonRemovalInfoAna::nsid [static, private]

Definition at line 34 of file MuonRemovalInfoAna.h.

Referenced by Analyze().

bool MuonRemovalInfoAna::readabidfile = false [static, private]

Definition at line 37 of file MuonRemovalInfoAna.h.

Referenced by Analyze().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1