MeuCuts Class Reference

#include <MeuCuts.h>

List of all members.

Public Member Functions

 MeuCuts ()
 ~MeuCuts ()
Bool_t AnalyseCoilProximity (AtmosEvent &ev, const MeuSummary &s, Float_t *r=0) const
void CalcXYZ (const AtmosEvent &ev, const AtmosStrip &st, Float_t &x, Float_t &y, Float_t &z) const
Bool_t CheckTrkViews (const MeuSummary &s, Int_t *diffAtVtx, Int_t *diffAtEnd) const
void ConvertToXY (const MeuSummary &s, std::map< Int_t, MeuHitInfo > &plInfo) const
void ExtractPlInfo (const NtpStRecord &ntp, MeuSummary &s, std::map< Int_t, MeuHitInfo > &plInfo, const NtpSREvent &evt) const
void ExtractPlInfo (const AtmosEvent &ntp, MeuSummary &s, std::map< Int_t, MeuHitInfo > &plInfo) const
void ExtractTruthInfo (const NtpStRecord &ntp, MeuSummary &s, std::map< Int_t, MeuHitInfo > &plInfo) const
void ExtractTruthInfo (const AtmosEvent &ev, MeuSummary &s, std::map< Int_t, MeuHitInfo > &plInfo) const
void FillBeamMonDetails (const NtpBDLiteRecord &bd, MeuSummary &s) const
void FillEnVsDist (const MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo) const
void FillEnVsDist2 (const MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo) const
void FillSTSumDetails (const NtpStRecord &ntp, MeuSummary &s, Int_t evt, Int_t slc) const
void FillSTSumDetails (const AtmosEvent &ev, MeuSummary &s) const
void FillSTSumRecoDetails (MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo) const
void FillTimeHistos (const NtpStRecord &ntp, const NtpSREvent &evt, const MeuSummary &s) const
Bool_t FilterBadEndGaps (const MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo, Float_t *adcInGap=0) const
Bool_t FilterBadEvtPerSlc (const NtpStRecord &ntp, Int_t slc, Int_t entry, Int_t *evts=0) const
Bool_t FilterBadTrackEnd (const MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo, Float_t *sigBeyondEnd=0) const
Bool_t FilterBadDistEndStrip (const MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo, Float_t *minDistEndStrip=0) const
Bool_t FilterBadShwDist (const NtpStRecord &ntp, MeuSummary &s, const NtpSREvent &evt, Int_t *shwDist=0) const
Bool_t FilterBadTrkTimes (const NtpStRecord &ntp, MeuSummary &s, const NtpSREvent &evt) const
Bool_t FilterBadXY (const AtmosEvent &ev, const MeuSummary &s) const
Bool_t FilterLowMatTraversed (const MeuSummary &s) const
void GetBDSelectSpillInfo (const NtpBDLiteRecord &ntpBD, MeuSummary &s, Int_t entry, Int_t &goodSpillCounter) const
Bool_t IsAwayFromCoil (const MeuSummary &s, const std::map< Int_t, MeuHitInfo > &plInfo, Float_t *r=0) const
Bool_t IsCorrectTrigSrc (const MeuSummary &s) const
Bool_t IsInPittFidVol (Float_t x, Float_t y, Float_t z, Float_t u, Float_t v) const
Bool_t IsGoodDataQuality (const NtpStRecord &ntp) const
void PrintNtpSt (const NtpStRecord &ntp) const
void SetSpecificCuts (MeuSummary &s) const


Detailed Description

Definition at line 22 of file MeuCuts.h.


Constructor & Destructor Documentation

MeuCuts::MeuCuts (  ) 

Definition at line 52 of file MeuCuts.cxx.

References Msg::kDebug, and MSG.

00053 {
00054   MSG("MeuCuts",Msg::kDebug)
00055     <<"Running MeuCuts Constructor..."<<endl;
00056 
00057 
00058   MSG("MeuCuts",Msg::kDebug)
00059     <<"Finished MeuCuts Constructor"<<endl;
00060 }

MeuCuts::~MeuCuts (  ) 

Definition at line 64 of file MeuCuts.cxx.

References Msg::kDebug, and MSG.

00065 {
00066   MSG("MeuCuts",Msg::kDebug)
00067     <<"Running MeuCuts Destructor..."<<endl;
00068   
00069 
00070   MSG("MeuCuts",Msg::kDebug)
00071     <<"Finished MeuCuts Destructor"<<endl;
00072 }


Member Function Documentation

Bool_t MeuCuts::AnalyseCoilProximity ( AtmosEvent ev,
const MeuSummary s,
Float_t *  r = 0 
) const

Definition at line 1496 of file MeuCuts.cxx.

References Msg::kDebug, Msg::kInfo, Msg::kVerbose, Msg::kWarning, MAXMSG, MSG, AtmosStrip::Plane, AtmosStrip::QPEcorr, Munits::s, AtmosEvent::StripList, and AtmosStrip::Trk.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu().

01498 {
01499   Bool_t awayFromCoil=false;  
01500   std::string sLogLevel="kDebug";
01501   //set up the log level (can't use msg in .h file???)
01502   Msg::LogLevel_t logLevel=Msg::kInfo;
01503   if (sLogLevel=="kDebug") logLevel=Msg::kDebug;
01504   if (sLogLevel=="kVerbose") logLevel=Msg::kVerbose;
01505 
01506   if (s.VtxPlane<0 || s.EndPlane<0){
01507     MSG("MeuCuts",Msg::kWarning)
01508       <<"No vtx and/or end plane for this event!"<<endl;
01509     return awayFromCoil;
01510   } 
01511 
01512   map<Int_t,Float_t> plEnDep;
01513   map<Int_t,TVector3> plPosition;
01514   Float_t smallestRadius=99999;
01515    
01516   TClonesArray& strips=(*ev.StripList);
01517   Int_t numStrips=strips.GetEntries();
01518   
01520   //loop over the strips in the snarl
01522   for (Int_t hit=0;hit<numStrips;hit++){
01523     const AtmosStrip* strip=dynamic_cast<AtmosStrip*>(strips[hit]);
01524     const AtmosStrip& st=(*strip);
01525     
01526     //cut out the non-tracked strips
01527     if (!st.Trk) continue;
01528     
01529     //calc the x,y,z positions
01530     Float_t x=-99999;
01531     Float_t y=-99999;
01532     Float_t z=-99999;
01533     this->CalcXYZ(ev,st,x,y,z);
01534     if (fabs(x)>6 || fabs(y)>6) MSG("MeuCuts",Msg::kWarning)
01535       <<"silly x or y; x="<<x<<", y="<<y<<endl;
01536     
01537     if (!(plEnDep.count(st.Plane))) plEnDep[st.Plane]+=(st.QPEcorr[0]+st.QPEcorr[1]);
01538     else {
01539       //this->PrintSnarlInfo(ev,sLogLevel);
01540       MSG("MeuCuts",logLevel)
01541         <<"Already filled en dep for this plane="<<st.Plane<<endl;
01542     }
01543 
01544     //add the positions to the map as long as it hasn't already 
01545     //been done
01546     if (plPosition.count(st.Plane)) {
01547       //this->PrintSnarlInfo(ev,sLogLevel);
01548       MSG("MeuCuts",logLevel)<<"already filled plane"<<endl;
01549     }
01550     else  plPosition[st.Plane]=TVector3(x,y,z);
01551     
01552     //check if radius is smaller than current smallest
01553     Float_t radius=sqrt(pow(x,2)+pow(y,2));
01554     if (radius<smallestRadius) smallestRadius=radius;
01555 
01556   }//end of loop over strips
01557 
01558   //analyse coil proximity
01559   if (smallestRadius>s.RFidCoil && smallestRadius<5) awayFromCoil=true;
01560 
01561   MAXMSG("MeuCuts",logLevel,200)
01562     <<"Coil: smallest radius="<<smallestRadius
01563     <<", fRFidCoil="<<s.RFidCoil
01564     <<", awayFromCoil="<<awayFromCoil
01565     <<", vtxPl="<<s.VtxPlane<<", endPl="<<s.EndPlane<<endl;
01566   
01567   //set the output variable
01568   if (r) *r=smallestRadius;
01569 
01570   //print out info below for these cases
01571   Bool_t printDiagnostics=false;
01572   if (!awayFromCoil && printDiagnostics){
01573     MAXMSG("MeuCuts",Msg::kInfo,5000)
01574       <<"Potentially hit coil: smallest radius="<<smallestRadius
01575       <<", vtxPl="<<s.VtxPlane<<", endPl="<<s.EndPlane<<endl;
01576     
01577     //calc direction of muon
01578     Bool_t tmpPosDir=true;
01579     if (s.VtxPlane-s.EndPlane>0) tmpPosDir=false;
01580     const Bool_t posDir=tmpPosDir;
01581 
01583     //loop over the track, starting at the vtx (not the end)
01585     Int_t pl=s.VtxPlane;
01586     Int_t endPlane=s.EndPlane-1;
01587     if (posDir) endPlane=s.EndPlane+1;
01588     while (pl!=endPlane){    
01589       
01590       Float_t x=-99999;
01591       Float_t y=-99999;
01592       Float_t z=-99999;
01593       Float_t radius=-99999;
01594 
01595       //look at position if it exists
01596       map<Int_t,TVector3>::iterator plPosIt=plPosition.find(pl);
01597       map<Int_t,TVector3>::iterator plPosEndIt=plPosition.end();
01598       if (plPosIt!=plPosEndIt){
01599         TVector3& plPos=plPosIt->second;
01600         x=plPos.X();
01601         y=plPos.Y();
01602         z=plPos.Z();
01603 
01604         //analyse coil proximity
01605         radius=sqrt(pow(x,2)+pow(y,2));
01606       }
01607 
01608       MAXMSG("MeuCuts",Msg::kInfo,5000)
01609         <<"pl="<<pl<<": r="<<radius
01610         <<", x="<<x<<", y="<<y<<", z="<<z<<endl;
01611 
01612       //increment the plane
01613       if (posDir) pl++;
01614       else pl--;
01615     }
01616   }
01617   
01618   return awayFromCoil;
01619 }

void MeuCuts::CalcXYZ ( const AtmosEvent ev,
const AtmosStrip st,
Float_t &  x,
Float_t &  y,
Float_t &  z 
) const

Definition at line 1466 of file MeuCuts.cxx.

References SimFlag::kData, Detector::kFar, PlaneView::kU, PlaneView::kV, AtmosStrip::L, AtmosStrip::T, UgliGeomHandle::uvz2xyz(), AtmosStrip::View, and AtmosStrip::Z.

01469 {
01470   VldTimeStamp vldts;
01471   //VldTimeStamp vldts(ev.UnixTime,0);
01472   //always kFar here because AtmosEvent
01473   VldContext vc(Detector::kFar,SimFlag::kData,vldts);
01474   //get the ugh
01475   UgliGeomHandle ugh(vc);
01476   TVector3 uvz;
01477   uvz.SetZ(st.Z);
01478   if ((st.View+2)==PlaneView::kU){
01479     uvz.SetX(st.T);//tpos measures u
01480     uvz.SetY(st.L);//lpos measures v
01481   }
01482   else if ((st.View+2)==PlaneView::kV){
01483     uvz.SetX(st.L);
01484     uvz.SetY(st.T);
01485   }
01486   else cout<<"Ahhhhhh"<<endl;
01487   TVector3 xyz = ugh.uvz2xyz(uvz);
01488   
01489   x=xyz.X();
01490   y=xyz.Y();
01491   z=xyz.Z();
01492 }

Bool_t MeuCuts::CheckTrkViews ( const MeuSummary s,
Int_t *  diffAtVtx,
Int_t *  diffAtEnd 
) const

Definition at line 93 of file MeuCuts.cxx.

References Msg::kDebug, Detector::kFar, Msg::kInfo, Detector::kNear, MAXMSG, and Munits::s.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::N_1Plots(), and MeuAnalysis::SpillPlots().

00095 {
00096   Bool_t noLargeDifference=true;
00097   
00098   if (s.MinPlane3!=999 && s.MaxPlane3!=-1 &&
00099       s.MinPlane2!=999 && s.MaxPlane2!=-1){
00100       
00101     Int_t diffAtLow=abs(s.MinPlane2-s.MinPlane3);
00102     Int_t diffAtHigh=abs(s.MaxPlane2-s.MaxPlane3);
00103     MAXMSG("MeuCuts",Msg::kDebug,100)
00104       <<"diffAtLow="<<diffAtLow
00105       <<", fMinPlane2="<<s.MinPlane2
00106       <<", fMinPlane3="<<s.MinPlane3<<endl
00107       <<"diffAtHigh="<<diffAtHigh
00108       <<", fMaxPlane2="<<s.MaxPlane2
00109       <<", fMaxPlane3="<<s.MaxPlane3<<endl;
00110 
00111     Bool_t posDir=s.VtxPlane<s.EndPlane;
00112     Int_t diffE=diffAtHigh;
00113     Int_t diffV=diffAtLow;
00114     if (!posDir) { 
00115       diffE=diffAtLow;
00116       diffV=diffAtHigh;
00117     }
00118 
00119     //a gap of 1 is expected
00120     //a gap of 3 means that 1 plane is missing at the end of 1 view
00121     //a gap of 5 means that 2 planes are missing at the end of 1 view
00122     //a gap of 7 means that 3 planes are missing at the end of 1 view
00123     //a gap of 9 means that 4 planes are missing at the end of 1 view
00124       
00125     //allow for 2 planes to be missing at the 
00126     //end of one view
00127       
00128     //in the near detector the full planes mean that 4 planes
00129     //are missing between views even with 100% efficiency
00130 
00131     if (s.Detector==Detector::kFar){
00132       if (diffAtLow>=7 || diffAtHigh>=7){//equivalent to >5
00133         MAXMSG("MeuCuts",Msg::kDebug,100)
00134           <<"Found large gap:"<<endl
00135           <<"diffAtLow="<<diffAtLow
00136           <<", fMinPlane2="<<s.MinPlane2
00137           <<", fMinPlane3="<<s.MinPlane3<<endl
00138           <<"diffAtHigh="<<diffAtHigh
00139           <<", fMaxPlane2="<<s.MaxPlane2
00140           <<", fMaxPlane3="<<s.MaxPlane3
00141           <<endl;
00142         noLargeDifference=false;
00143       }
00144     }
00145     else if (s.Detector==Detector::kNear){
00146       if (diffE>=7 || diffV>=11){
00147         MAXMSG("MeuCuts",Msg::kDebug,100)
00148           <<"Found large gap:"<<endl
00149           <<"diffLow="<<diffAtLow
00150           <<", MinPl2="<<s.MinPlane2
00151           <<", MinPl3="<<s.MinPlane3<<endl
00152           <<"diffHigh="<<diffAtHigh
00153           <<", MaxPl2="<<s.MaxPlane2
00154           <<", MaxPl3="<<s.MaxPlane3
00155           <<", dE="<<diffE
00156           <<", dV="<<diffV
00157           <<endl;
00158         noLargeDifference=false;
00159       }
00160     }
00161     else cout<<"No detector type!"<<endl;
00162 
00163     //write out the info if requested
00164     if (diffAtVtx!=0 && diffAtEnd!=0) {
00165       *diffAtVtx=diffV;
00166       *diffAtEnd=diffE;
00167     }   
00168   }
00169   else{
00170     MAXMSG("MeuCuts",Msg::kInfo,50)
00171       <<"Can't analyse track views because variables not set"<<endl;
00172     noLargeDifference=false;
00173   }
00174 
00175   return noLargeDifference;
00176 }

void MeuCuts::ConvertToXY ( const MeuSummary s,
std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 1732 of file MeuCuts.cxx.

References SimFlag::kData, Msg::kDebug, Msg::kInfo, PlaneView::kU, PlaneView::kV, MAXMSG, Munits::s, and UgliGeomHandle::uvz2xyz().

01733 {
01734   //variable to turn on all the useful messages if required
01735   Msg::LogLevel_t logLevel=Msg::kDebug;
01736   
01737   MAXMSG("MeuCuts",logLevel,1000)
01738     <<endl<<"ConvertToXY: Turn TPos, LPos and z -> xyz"<<endl;
01739 
01740   Float_t initValue=-999;
01741   Bool_t posDir=(s.EndPlane>s.VtxPlane);
01742   
01743   //get variables for loops
01744   Int_t pl=s.VtxPlane;
01745   Int_t tmpEndPlane=s.EndPlane;
01746   if (posDir) tmpEndPlane++;//make sure last plane is used
01747   else tmpEndPlane--;
01748   
01749   VldTimeStamp vldts;
01750   //VldTimeStamp vldts(ev.UnixTime,0);
01751   VldContext vc(static_cast<Detector::Detector_t>(s.Detector),
01752                 SimFlag::kData,vldts);
01753   //get the ugh
01754   UgliGeomHandle ugh(vc);
01755   TVector3 uvz;
01756 
01757   //loop and calc xyz using tpos, lpos and z in each plane
01758   //while (pl!=tmpEndPlane){
01759   typedef map<Int_t,MeuHitInfo>::iterator plIt;
01760   for (plIt it=plInfo.begin();it!=plInfo.end();++it){
01761     
01762     //cache the current cp
01763     MeuHitInfo& cp=it->second;
01764 
01765     if (cp.LPos==-999) continue;
01766     
01767     //set z first
01768     uvz.SetZ(cp.Z);
01769     
01770     //now decide what tpos and lpos measure depending on the view
01771     if (cp.View==PlaneView::kU){
01772       uvz.SetX(cp.TPos);//in u-view tpos measures u
01773       uvz.SetY(cp.LPos);//in u-view lpos measures v
01774     }
01775     else if (cp.View==PlaneView::kV){
01776       uvz.SetY(cp.TPos);//in v-view tpos measures v
01777       uvz.SetX(cp.LPos);//in v-view lpos measures u
01778     }
01779     else cout<<"ahhhhhhh no plane view"<<endl;
01780 
01781     //now calc xyz
01782     TVector3 xyz=ugh.uvz2xyz(uvz);
01783     
01784     //now set the cp x and y
01785     cp.X=xyz.X();
01786     cp.Y=xyz.Y();
01787 
01788     MAXMSG("MeuCuts",logLevel,1000)
01789       <<"pl="<<pl<<", cp: X="<<cp.X<<", Y="<<cp.Y<<", Z="<<cp.Z
01790       <<", LPos="<<cp.LPos<<endl;
01791 
01792     //now zero the LPos value since later algorithms use it
01793     //to look for gaps. This is bad coding on my part!
01794     cp.LPos=initValue;
01795     MAXMSG("MeuCuts",Msg::kInfo,1)
01796       <<"Doing nasty hack for AtmosEvent X and Y pos"<<endl;
01797   }
01798 }

void MeuCuts::ExtractPlInfo ( const AtmosEvent ntp,
MeuSummary s,
std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 1802 of file MeuCuts.cxx.

References MeuHitInfo::Adc, MeuHitInfo::Adc1, MeuHitInfo::Adc2, AtmosStrip::L, MeuHitInfo::LPos, AtmosStrip::Ndigits, MeuHitInfo::NumDigits, MeuHitInfo::NumStrips, MeuHitInfo::Pe, MeuHitInfo::Pe1, MeuHitInfo::Pe2, MeuHitInfo::Plane, AtmosStrip::Plane, AtmosStrip::Qadc, AtmosStrip::QPE, AtmosStrip::QPEcorr, Munits::s, MeuHitInfo::SigCor, MeuHitInfo::SigCor1, MeuHitInfo::SigCor2, MeuHitInfo::SigLin, MeuHitInfo::SigLin1, MeuHitInfo::SigLin2, AtmosEvent::StripList, AtmosStrip::Trk, AtmosStrip::View, MeuHitInfo::View, AtmosStrip::Z, and MeuHitInfo::Z.

01804 {
01805   //variable to turn on all the useful messages if required
01806   //Msg::LogLevel_t logLevel=Msg::kDebug;
01807 
01808   map<Int_t,MeuHitInfo> plSigCorLast;
01809   map<Int_t,Double_t> time0;
01810   map<Int_t,Double_t> time1;
01811 
01812   TClonesArray& strips=(*ev.StripList);
01813   Int_t numStrips=strips.GetEntries();
01815   //loop over the strips in the snarl
01817   for (Int_t hit=0;hit<numStrips;hit++){
01818     const AtmosStrip* strip=dynamic_cast<AtmosStrip*>(strips[hit]);
01819     const AtmosStrip& st=(*strip);
01820     
01821     Int_t pl=st.Plane;
01822     MeuHitInfo& cp=plInfo[pl];//get a reference to save looking up later
01823 
01824     //set the position variables that are plane based
01825     cp.Plane=pl;
01826     cp.View=(st.View+2);
01827     cp.Z=st.Z;
01828 
01829     //also set the lpos so you can get at x and y
01830     cp.LPos=st.L;
01831     
01832     //sum the energy deposition
01833     cp.Adc+=(st.Qadc[1]+st.Qadc[0]);
01834     cp.Adc1+=st.Qadc[0];
01835     cp.Adc2+=st.Qadc[1];
01836     cp.Pe+=st.QPE[0]+st.QPE[1];
01837     cp.Pe1+=st.QPE[0];
01838     cp.Pe2+=st.QPE[1];
01839     cp.SigLin+=(st.Qadc[1]+st.Qadc[0]);//not right
01840     cp.SigLin1+=st.Qadc[0];//not right
01841     cp.SigLin2+=st.Qadc[1];//not right
01842     cp.SigCor+=(st.QPEcorr[0]+st.QPEcorr[1]);
01843     cp.SigCor1+=st.QPEcorr[0];
01844     cp.SigCor2+=st.QPEcorr[1];
01845 
01846     //sum the number of digits/buckets
01847     cp.NumDigits+=st.Ndigits;
01848     cp.NumStrips++;
01849 
01850     //cut out the non-tracked strips
01851     if (!st.Trk) continue;
01852 
01853     //get the min and max planes for each view
01854     if (st.View==0){
01855       if (pl>s.MaxPlane2) s.MaxPlane2=pl;
01856       if (pl<s.MinPlane2) s.MinPlane2=pl;
01857     }
01858     else if (st.View==1){
01859       if (pl>s.MaxPlane3) s.MaxPlane3=pl;
01860       if (pl<s.MinPlane3) s.MinPlane3=pl;
01861     }
01862     else cout<<"No view"<<endl;
01863     
01864     //record the best strip found in each plane
01865     MeuHitInfo& tmpcp=plSigCorLast[pl];
01866     //check if already found a tracked strip on this plane
01867     if (cp.Strip<0){//no strip found yet
01868       //set the variables
01869       cp.Strip=st.Strip;
01870       cp.TPos=st.T;
01871 
01872       //store the sigcor of both ends of the tracked strip
01873       //this means that fSigCor!=fSigCor1+fSigCor2 always
01874       cp.SigCorTrk1=st.QPEcorr[0];
01875       cp.SigCorTrk2=st.QPEcorr[1];
01876 
01877       //store as current best
01878       tmpcp.Strip=st.Strip;
01879       tmpcp.TPos=st.T;
01880       tmpcp.SigCor=(st.QPEcorr[0]+st.QPEcorr[1]);
01881       time0[pl]=st.Tcal[1];
01882       time1[pl]=st.Tcal[0];
01883     }
01884     else{//already have a strip
01885       MAXMSG("MeuCuts",Msg::kWarning,10)
01886         <<"Choosing between strips... run="<<ev.Run
01887         <<", sn="<<ev.Snarl<<endl
01888         <<"  prev: pl="<<pl<<", st="<<tmpcp.Strip
01889         <<", sigcor="<<tmpcp.SigCor
01890         <<", t0="<<time0[pl]*1e9<<", t1="<<time1[pl]*1e9
01891         <<endl
01892         <<"  next: pl="<<pl<<", st="<<st.Strip
01893         <<", sigcor="<<(st.QPEcorr[0]+st.QPEcorr[1])
01894         <<", t0="<<st.Tcal[1]*1e9<<", t1="<<st.Tcal[0]*1e9<<endl;
01895 
01896       //decide whether to use current strip or best previous strip
01897       if ((st.QPEcorr[0]+st.QPEcorr[1])>tmpcp.SigCor){
01898         cp.Strip=st.Strip;
01899         cp.TPos=st.T;
01900 
01901         //store the sigcor of both ends of the tracked strip
01902         //this means that fSigCor!=fSigCor1+fSigCor2 always
01903         cp.SigCorTrk1=st.QPEcorr[0];
01904         cp.SigCorTrk2=st.QPEcorr[1];
01905 
01906         //store this strip as the best current strip
01907         tmpcp.Strip=st.Strip;
01908         tmpcp.TPos=st.T;
01909         tmpcp.SigCor=(st.QPEcorr[0]+st.QPEcorr[1]);
01910         time0[pl]=st.Tcal[1];
01911         time1[pl]=st.Tcal[0];
01912         MAXMSG("MeuCuts",Msg::kDebug,1000)
01913           <<"...using new strip"<<endl;
01914       }
01915       else{ //already using best previous strip
01916         MAXMSG("MeuCuts",Msg::kDebug,1000)
01917           <<"...using previous strip"<<endl;
01918       }
01919     }
01920   }//end of loop over strips
01921 
01922   //now calc the xy info
01923   this->ConvertToXY(s,plInfo);
01924 }

void MeuCuts::ExtractPlInfo ( const NtpStRecord ntp,
MeuSummary s,
std::map< Int_t, MeuHitInfo > &  plInfo,
const NtpSREvent evt 
) const

Definition at line 1928 of file MeuCuts.cxx.

References MeuHitInfo::Adc, MeuHitInfo::Adc1, MeuHitInfo::Adc2, Msg::kDebug, Msg::kInfo, MAXMSG, Munits::ns, MeuHitInfo::NumDigits, MeuHitInfo::NumStrips, MeuHitInfo::Pe, MeuHitInfo::Pe1, MeuHitInfo::Pe2, MeuHitInfo::Plane, Munits::s, MeuHitInfo::SigCor, MeuHitInfo::SigCor1, MeuHitInfo::SigCor2, MeuHitInfo::SigLin, MeuHitInfo::SigLin1, MeuHitInfo::SigLin2, NtpSREvent::slc, NtpStRecord::slc, NtpStRecord::stp, and MeuHitInfo::View.

Referenced by MeuAnalysis::BasicReco(), MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::N_1Plots(), MeuAnalysis::SnarlList(), and MeuAnalysis::SpillPlots().

01931 {
01932   //variable to turn on all the useful messages if required
01933   Msg::LogLevel_t logLevel=Msg::kDebug;
01934 
01935   //calibration test histos
01936   static TH1F* hAdcPerSigLinNtp1=0;
01937   static TH1F* hSigLinPerSigCorNtp1=0;
01938   static TH1F* hSigCorPerSigMapNtp1=0;
01939   static TH1F* hSigMapPerMipNtp1=0;
01940   static TH1F* hMipPerGeVNtp1=0;
01941   static TH1F* hAdcPerPeNtp1=0;
01942 
01943   static TH1F* hAdcPerSigLinNtp2=0;
01944   static TH1F* hSigLinPerSigCorNtp2=0;
01945   static TH1F* hSigCorPerSigMapNtp2=0;
01946   static TH1F* hSigMapPerMipNtp2=0;
01947   static TH1F* hMipPerGeVNtp2=0;
01948   static TH1F* hAdcPerPeNtp2=0;
01949 
01950   if (hAdcPerSigLinNtp1==0) {
01951     //stripend 1
01952     hAdcPerSigLinNtp1=new TH1F("hAdcPerSigLinNtp1","hAdcPerSigLinNtp1",
01953                               1100,-1,10);
01954     hAdcPerSigLinNtp1->SetFillColor(0);
01955     hAdcPerSigLinNtp1->SetTitle("AdcPerSigLin");
01956     hAdcPerSigLinNtp1->GetXaxis()->SetTitle("AdcPerSigLin");
01957     hAdcPerSigLinNtp1->GetXaxis()->CenterTitle();
01958     //hAdcPerSigLinNtp1->SetBit(TH1::kCanRebin);
01959     
01960     hSigLinPerSigCorNtp1=new TH1F("hSigLinPerSigCorNtp1",
01961                                  "hSigLinPerSigCorNtp1",
01962                                  1100,-1,10);
01963     hSigLinPerSigCorNtp1->SetFillColor(0);
01964     hSigLinPerSigCorNtp1->SetTitle("SigLinPerSigCor");
01965     hSigLinPerSigCorNtp1->GetXaxis()->SetTitle("SigLinPerSigCor");
01966     hSigLinPerSigCorNtp1->GetXaxis()->CenterTitle();
01967     //hSigLinPerSigCorNtp1->SetBit(TH1::kCanRebin);
01968     
01969     hSigCorPerSigMapNtp1=new TH1F("hSigCorPerSigMapNtp1",
01970                                  "hSigCorPerSigMapNtp1",
01971                                  10000,-1,100);
01972     hSigCorPerSigMapNtp1->SetFillColor(0);
01973     hSigCorPerSigMapNtp1->SetTitle("SigCorPerSigMap");
01974     hSigCorPerSigMapNtp1->GetXaxis()->SetTitle("SigCorPerSigMap");
01975     hSigCorPerSigMapNtp1->GetXaxis()->CenterTitle();
01976     //hSigCorPerSigMapNtp1->SetBit(TH1::kCanRebin);
01977     
01978     hSigMapPerMipNtp1=new TH1F("hSigMapPerMipNtp1",
01979                               "hSigMapPerMipNtp1",
01980                               10100,-10,1000);
01981     hSigMapPerMipNtp1->SetFillColor(0);
01982     hSigMapPerMipNtp1->SetTitle("SigMapPerMip");
01983     hSigMapPerMipNtp1->GetXaxis()->SetTitle("SigMapPerMip");
01984     hSigMapPerMipNtp1->GetXaxis()->CenterTitle();
01985     //hSigMapPerMipNtp1->SetBit(TH1::kCanRebin);
01986     
01987     hMipPerGeVNtp1=new TH1F("hMipPerGeVNtp1","hMipPerGeVNtp1",
01988                            10100,-10,1000);
01989     hMipPerGeVNtp1->SetFillColor(0);
01990     hMipPerGeVNtp1->SetTitle("MipPerGeV");
01991     hMipPerGeVNtp1->GetXaxis()->SetTitle("MipPerGeV");
01992     hMipPerGeVNtp1->GetXaxis()->CenterTitle();
01993     //hMipPerGeVNtp1->SetBit(TH1::kCanRebin);
01994 
01995     hAdcPerPeNtp1=new TH1F("hAdcPerPeNtp1","hAdcPerPeNtp1",
01996                            8080,-20,2000);
01997     hAdcPerPeNtp1->SetFillColor(0);
01998     hAdcPerPeNtp1->SetTitle("AdcPerPe");
01999     hAdcPerPeNtp1->GetXaxis()->SetTitle("AdcPerPe");
02000     hAdcPerPeNtp1->GetXaxis()->CenterTitle();
02001     //hAdcPerPeNtp1->SetBit(TH1::kCanRebin);
02002 
02003 
02004     //stripend 2
02005     hAdcPerSigLinNtp2=new TH1F("hAdcPerSigLinNtp2","hAdcPerSigLinNtp2",
02006                               1100,-1,10);
02007     hAdcPerSigLinNtp2->SetFillColor(0);
02008     hAdcPerSigLinNtp2->SetTitle("AdcPerSigLin");
02009     hAdcPerSigLinNtp2->GetXaxis()->SetTitle("AdcPerSigLin");
02010     hAdcPerSigLinNtp2->GetXaxis()->CenterTitle();
02011     //hAdcPerSigLinNtp2->SetBit(TH1::kCanRebin);
02012     
02013     hSigLinPerSigCorNtp2=new TH1F("hSigLinPerSigCorNtp2",
02014                                  "hSigLinPerSigCorNtp2",
02015                                  1100,-1,10);
02016     hSigLinPerSigCorNtp2->SetFillColor(0);
02017     hSigLinPerSigCorNtp2->SetTitle("SigLinPerSigCor");
02018     hSigLinPerSigCorNtp2->GetXaxis()->SetTitle("SigLinPerSigCor");
02019     hSigLinPerSigCorNtp2->GetXaxis()->CenterTitle();
02020     //hSigLinPerSigCorNtp2->SetBit(TH1::kCanRebin);
02021     
02022     hSigCorPerSigMapNtp2=new TH1F("hSigCorPerSigMapNtp2",
02023                                  "hSigCorPerSigMapNtp2",
02024                                  10000,-1,100);
02025     hSigCorPerSigMapNtp2->SetFillColor(0);
02026     hSigCorPerSigMapNtp2->SetTitle("SigCorPerSigMap");
02027     hSigCorPerSigMapNtp2->GetXaxis()->SetTitle("SigCorPerSigMap");
02028     hSigCorPerSigMapNtp2->GetXaxis()->CenterTitle();
02029     //hSigCorPerSigMapNtp2->SetBit(TH1::kCanRebin);
02030     
02031     hSigMapPerMipNtp2=new TH1F("hSigMapPerMipNtp2",
02032                               "hSigMapPerMipNtp2",
02033                               10100,-10,1000);
02034     hSigMapPerMipNtp2->SetFillColor(0);
02035     hSigMapPerMipNtp2->SetTitle("SigMapPerMip");
02036     hSigMapPerMipNtp2->GetXaxis()->SetTitle("SigMapPerMip");
02037     hSigMapPerMipNtp2->GetXaxis()->CenterTitle();
02038     //hSigMapPerMipNtp2->SetBit(TH1::kCanRebin);
02039     
02040     hMipPerGeVNtp2=new TH1F("hMipPerGeVNtp2","hMipPerGeVNtp2",
02041                            10100,-10,1000);
02042     hMipPerGeVNtp2->SetFillColor(0);
02043     hMipPerGeVNtp2->SetTitle("MipPerGeV");
02044     hMipPerGeVNtp2->GetXaxis()->SetTitle("MipPerGeV");
02045     hMipPerGeVNtp2->GetXaxis()->CenterTitle();
02046     //hMipPerGeVNtp2->SetBit(TH1::kCanRebin);
02047 
02048     hAdcPerPeNtp2=new TH1F("hAdcPerPeNtp2","hAdcPerPeNtp2",
02049                            8080,-20,2000);
02050     hAdcPerPeNtp2->SetFillColor(0);
02051     hAdcPerPeNtp2->SetTitle("AdcPerPe");
02052     hAdcPerPeNtp2->GetXaxis()->SetTitle("AdcPerPe");
02053     hAdcPerPeNtp2->GetXaxis()->CenterTitle();
02054     //hAdcPerPeNtp2->SetBit(TH1::kCanRebin);
02055   }
02056 
02057   map<Int_t,MeuHitInfo> plSigCorLast;
02058   map<Int_t,Double_t> time0;
02059   map<Int_t,Double_t> time1;
02060 
02061   TClonesArray& stpTca=(*ntp.stp);
02062   //Int_t numStps=stpTca.GetEntries();
02063 
02064   TClonesArray& slcTca=(*ntp.slc);
02065   const Int_t numSlcs=slcTca.GetEntries();
02066   if (evt.slc>=numSlcs) cout<<"Ahhhhhh, num slcs"<<endl;
02067   
02068   //get the slice associated with this event
02069   const NtpSRSlice* pslc=
02070     dynamic_cast<NtpSRSlice*>(slcTca[evt.slc]);
02071   const NtpSRSlice& slc=(*pslc);
02072 
02073   //loop over strips in slc
02074   for (Int_t i=0;i<slc.nstrip;++i) {
02075     const NtpSRStrip* pstp=
02076       dynamic_cast<NtpSRStrip*>(stpTca[slc.stp[i]]);
02077     const NtpSRStrip& stp=(*pstp);
02078 
02079     //get the time0, if between 0 and 1 switch to time1
02080     Double_t time=stp.time0;
02081     if (time<0 || time>1) time=stp.time1;
02082     if (time<0 || time>1) cout<<"Ahhhhh, time"<<endl;;
02083     
02084     if (time>s.MedianTime+(400*Munits::ns) ||
02085         time<s.MedianTime-(400*Munits::ns)) {
02086       MAXMSG("MeuCuts",Msg::kInfo,10)
02087         <<"Cut strip: time="<<time
02088         <<", pl="<<stp.plane<<", st="<<stp.strip
02089         <<", sigCor="<<stp.ph0.sigcor+stp.ph1.sigcor
02090         <<", dT="<<(time-s.MedianTime)/Munits::ns<<endl;
02091       continue;//messes up beg/end planes (if not filtered bad trks)!
02092     }
02093     
02094     Int_t pl=stp.plane;
02095     MeuHitInfo& cp=plInfo[pl];//get a reference
02096       
02097     //set the position variables that are plane based
02098     cp.Plane=pl;
02099     cp.View=stp.planeview;
02100     //cp.Z=stp.Z;
02101       
02102     //sum the energy deposition
02103     cp.Adc+=stp.ph0.raw+stp.ph1.raw;
02104     cp.Adc1+=stp.ph0.raw;
02105     cp.Adc2+=stp.ph1.raw;
02106     cp.Pe+=stp.ph0.pe+stp.ph1.pe;
02107     cp.Pe1+=stp.ph0.pe;
02108     cp.Pe2+=stp.ph1.pe;
02109     cp.SigLin+=stp.ph0.siglin+stp.ph1.siglin;
02110     cp.SigLin1+=stp.ph0.siglin;
02111     cp.SigLin2+=stp.ph1.siglin;
02112     cp.SigCor+=stp.ph0.sigcor+stp.ph1.sigcor;
02113     cp.SigCor1+=stp.ph0.sigcor;
02114     cp.SigCor2+=stp.ph1.sigcor;
02115 
02116     //fill calibration test histos
02117     if (stp.ph0.siglin) hAdcPerSigLinNtp1->
02118                           Fill(stp.ph0.raw/stp.ph0.siglin);
02119     if (stp.ph0.sigcor) hSigLinPerSigCorNtp1->
02120                           Fill(stp.ph0.siglin/stp.ph0.sigcor);
02121     if (stp.ph0.pe) hAdcPerPeNtp1->
02122                       Fill(stp.ph0.raw/stp.ph0.pe);
02123     //fill calibration test histos
02124     if (stp.ph1.siglin) hAdcPerSigLinNtp2->
02125                           Fill(stp.ph1.raw/stp.ph1.siglin);
02126     if (stp.ph1.sigcor) hSigLinPerSigCorNtp2->
02127                           Fill(stp.ph1.siglin/stp.ph1.sigcor);
02128     if (stp.ph1.pe) hAdcPerPeNtp2->
02129                       Fill(stp.ph1.raw/stp.ph1.pe);
02130     
02131     //sum the number of digits/buckets
02132     cp.NumDigits+=stp.ndigit;
02133     //sum the number of strips
02134     cp.NumStrips++;
02135   }
02136   
02137   TClonesArray& trkTca=(*ntp.trk);
02138   //Int_t numTrks=tcaTk.GetEntries();
02139   Int_t numTrks=evt.ntrack;
02140   
02141   //Loop over tracks
02142   //for (Int_t itrk=0;itrk<numTrks;itrk++){
02143   //const NtpSRTrack* ptrk=
02144   //  dynamic_cast<NtpSRTrack*>(tcaTk[itrk]);
02145   
02146   for (Int_t itrk=0;itrk<numTrks;itrk++){
02147     const NtpSRTrack* ptrk=
02148       dynamic_cast<NtpSRTrack*>(trkTca[evt.trk[itrk]]);
02149     const NtpSRTrack& trk=(*ptrk);
02150     
02151     TClonesArray& stpTca=(*ntp.stp);
02152       
02153     //this loop is just over the tracked strips
02154     for (Int_t i=0;i<trk.nstrip;i++){
02155 
02156       //check for bug where strip index is -1
02157       if (trk.stp[i]<0) {
02158         MAXMSG("MeuCuts",Msg::kInfo,50)
02159           <<"Skipping strip with trk.stp[i]="<<trk.stp[i]<<endl;
02160         continue;
02161       }
02162 
02163       const NtpSRStrip* pstp=
02164         dynamic_cast<NtpSRStrip*>(stpTca[trk.stp[i]]);
02165       const NtpSRStrip& stp=(*pstp);
02166       //MAXMSG("NDMeuCuts",Msg::kInfo,200)
02167       //  <<"Strip="<<stp.strip<<", pl="<<stp.plane
02168       //  <<", sigCor="<<stp.ph1.sigcor<<", tpos="<<stp.tpos<<endl;
02169 
02170 
02171       //fill calibration test histos
02172       //note these 3 are only filled for tracked strips
02173       //stripend 1
02174       if (trk.stpph0sigmap[i]) hSigCorPerSigMapNtp1->
02175                                  Fill(stp.ph0.sigcor/
02176                                       trk.stpph0sigmap[i]);
02177       if (trk.stpph0mip[i]) hSigMapPerMipNtp1->
02178                               Fill(trk.stpph0sigmap[i]/
02179                                    trk.stpph0mip[i]);
02180       if (trk.stpph0gev[i]) hMipPerGeVNtp1->
02181                               Fill(trk.stpph0mip[i]/trk.stpph0gev[i]);
02182       //stripend 2
02183       if (trk.stpph1sigmap[i]) hSigCorPerSigMapNtp2->
02184                                  Fill(stp.ph1.sigcor/
02185                                       trk.stpph1sigmap[i]);
02186       if (trk.stpph1mip[i]) hSigMapPerMipNtp2->
02187                               Fill(trk.stpph1sigmap[i]/
02188                                    trk.stpph1mip[i]);
02189       if (trk.stpph1gev[i]) hMipPerGeVNtp2->
02190                               Fill(trk.stpph1mip[i]/trk.stpph1gev[i]);
02191       
02192       //check times
02193       Double_t time=stp.time0;
02194       if (time<0 || time>1) time=stp.time1;
02195       if (time<0 || time>1) cout<<"Ahhhhh, time"<<endl;;
02196 
02197       //sanity check that no trk times are outside window
02198       //trks with large dts should have been filtered
02199       if (time>s.MedianTime+(400*Munits::ns) ||
02200           time<s.MedianTime-(400*Munits::ns)) {
02201         MAXMSG("MeuCuts",Msg::kWarning,200)
02202           <<"Ahhhhhhh trk: time="<<time
02203           <<", pl="<<stp.plane<<", st="<<stp.strip
02204           <<", time-medTime="<<(time-s.MedianTime)/Munits::ns<<endl;
02205         continue;//messes up beg/end planes (if not already cut)
02206       }
02207       
02208       Int_t pl=stp.plane;
02209         
02210       //get the min and max planes for each view
02211       if (s.Detector!=Detector::kNear || 
02212           (s.Detector==Detector::kNear && pl<=120)) {
02213         if (stp.planeview==PlaneView::kU){
02214           if (pl>s.MaxPlane2) s.MaxPlane2=pl;
02215           if (pl<s.MinPlane2) s.MinPlane2=pl;
02216         }
02217         else if (stp.planeview==PlaneView::kV){
02218           if (pl>s.MaxPlane3) s.MaxPlane3=pl;
02219           if (pl<s.MinPlane3) s.MinPlane3=pl;
02220         }
02221         else cout<<"No view"<<endl;
02222       }
02223         
02224       //fill the calibpos
02225       MeuHitInfo& cp=plInfo[pl];
02226 
02227       //record the best strip found in each plane
02228       MeuHitInfo& tmpcp=plSigCorLast[pl];
02229       //check if already found a tracked strip on this plane
02230       if (cp.Strip<0){//no strip found yet
02231         //set the variables
02232         cp.Strip=stp.strip;
02233         cp.TPos=stp.tpos;
02234             
02235         //store the sigcor of both ends of the tracked strip
02236         //this means that fSigCor!=fSigCor1+fSigCor2 always
02237         cp.SigCorTrk1=stp.ph0.sigcor;
02238         cp.SigCorTrk2=stp.ph1.sigcor;
02239             
02240         cp.X=trk.stpx[i];
02241         cp.Y=trk.stpy[i];
02242         cp.Z=trk.stpz[i];
02243 
02244         //store as current best
02245         tmpcp.Strip=stp.strip;
02246         tmpcp.TPos=stp.tpos;
02247         tmpcp.SigCor=stp.ph0.sigcor+stp.ph1.sigcor;
02248         tmpcp.X=trk.stpx[i];
02249         tmpcp.Y=trk.stpy[i];
02250         tmpcp.Z=trk.stpz[i];
02251         //trk.stpph0sigmap[i];
02252         //trk.stpph0mip[i];
02253         //trk.stpph0gev[i];
02254         //trk.stpattn0c0[i];
02255         time0[pl]=stp.time0;
02256         time1[pl]=stp.time1;
02257       }
02258       else{//already have a strip
02259         MAXMSG("MeuCuts",logLevel,100)
02260           <<"Choosing between strips... run="//<<ev.Run
02261           //<<", sn="<<ev.Snarl<<endl
02262           <<"  prev: pl="<<pl<<", st="<<tmpcp.Strip
02263           <<", sigcor="<<tmpcp.SigCor
02264           <<", t0="<<time0[pl]*1e9<<", t1="<<time1[pl]*1e9
02265           <<endl
02266           <<"  next: pl="<<pl<<", st="<<stp.strip
02267           <<", sigcor="<<stp.ph0.sigcor+stp.ph1.sigcor
02268           <<", t0="<<stp.time0*1e9<<", t1="<<stp.time1*1e9
02269           <<endl;
02270             
02271         //decide whether to use current strip or best previous strip
02272         if (stp.ph0.sigcor+stp.ph1.sigcor>tmpcp.SigCor){
02273           cp.Strip=stp.strip;
02274           cp.TPos=stp.tpos;
02275                 
02276           //store the sigcor of both ends of the tracked strip
02277           //this means that fSigCor!=fSigCor1+fSigCor2 always
02278           cp.SigCorTrk1=stp.ph0.sigcor;
02279           cp.SigCorTrk2=stp.ph1.sigcor;
02280 
02281           cp.X=trk.stpx[i];
02282           cp.Y=trk.stpy[i];
02283           cp.Z=trk.stpz[i];
02284 
02285           //store this strip as the best current strip
02286           tmpcp.Strip=stp.strip;
02287           tmpcp.TPos=stp.tpos;
02288           tmpcp.SigCor=stp.ph0.sigcor+stp.ph1.sigcor;
02289           tmpcp.X=trk.stpx[i];
02290           tmpcp.Y=trk.stpy[i];
02291           tmpcp.Z=trk.stpz[i];
02292           time0[pl]=stp.time0;
02293           time1[pl]=stp.time1;
02294           MAXMSG("MeuCuts",logLevel,100)
02295             <<"...using new strip="<<cp.Strip<<endl;
02296         }
02297         else{ //already using best previous strip
02298           MAXMSG("MeuCuts",logLevel,100)
02299             <<"...using previous strip="<<cp.Strip<<endl;
02300         }
02301       }
02302     }
02303   }
02304 }

void MeuCuts::ExtractTruthInfo ( const AtmosEvent ev,
MeuSummary s,
std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 2360 of file MeuCuts.cxx.

References AtmosScintHit::Id, Msg::kInfo, SimFlag::kMC, MAXMSG, AtmosScintHit::ParticleE, AtmosScintHit::Plane, Munits::s, and AtmosEvent::ScintHitList.

02362 {
02363   if (s.SimFlag!=SimFlag::kMC) {
02364     MAXMSG("MeuCuts",Msg::kInfo,1)
02365       <<endl<<"Not extracting truth info, SimFlag="<<s.SimFlag<<endl;
02366     return;
02367   }
02368   
02369   //initialise
02370   Float_t lowEn=999999;
02371   Float_t highEn=-1;
02372   Int_t lowEnPl=-1;
02373   Int_t highEnPl=-1;
02374   Int_t mainParticle=0;
02375   Int_t muon=13;
02376   Double_t B=0.133;// (m/GeV)
02377   
02378   //have a vector for efficiency (expensive to search plInfo for dshs)
02379   vector<Float_t> vEn(1000);
02380   vector<Float_t> vEnSupp(1000);
02381 
02382   //loop over scint hits
02383   TClonesArray& scintHits=(*ev.ScintHitList);
02384   Int_t numDshs=scintHits.GetEntries();
02385   //loop over the truth hits
02386   for (Int_t hit=0;hit<numDshs;hit++){
02387     const AtmosScintHit* scintHit=
02388       dynamic_cast<AtmosScintHit*>(scintHits[hit]);
02389     const AtmosScintHit& dsh=(*scintHit);
02390     
02391     //get the highest and lowest muon energy and associated planes
02392     if (abs(dsh.Id)==muon) {
02393       mainParticle=dsh.Id;
02394       if (dsh.ParticleE>highEn) {
02395         highEn=dsh.ParticleE;
02396         highEnPl=dsh.Plane;
02397       }
02398       if (dsh.ParticleE<lowEn) {
02399         lowEn=dsh.ParticleE;
02400         lowEnPl=dsh.Plane;
02401       }
02402     }
02403 
02404     Double_t birksSupp=1;//complete saturation
02405     if (dsh.DS!=0) birksSupp=1-(1./(1+B*(dsh.DE/dsh.DS)));
02406     else {
02407       MAXMSG("MeuCuts",Msg::kInfo,5)
02408         <<"Zero pathlength in DSH: dE="<<dsh.DE
02409         <<", id="<<dsh.Id<<endl;
02410     }
02411     Double_t suppEnDep=(1-birksSupp)*dsh.DE;
02412     vEnSupp[dsh.Plane]+=suppEnDep;
02413     vEn[dsh.Plane]+=dsh.DE;
02414   }
02415 
02416   if (numDshs>0) {
02417     //reset to -1 if not found to be consistent with highEn
02418     if (lowEn==999999) lowEn=-1;
02419     
02420     //set all the variables
02421     s.MCHighEn=highEn;
02422     s.MCLowEn=lowEn;
02423     s.MCParticleId=mainParticle;
02424     s.MCVtxPlane=highEnPl;
02425     s.MCEndPlane=lowEnPl;
02426     
02427     //now transfer the cache of variables to the map
02428     typedef map<Int_t,MeuHitInfo>::iterator iter;
02429     for (iter it=plInfo.begin();it!=plInfo.end();++it){
02430       MeuHitInfo& cp=it->second;
02431       cp.MCEnDep+=vEn[cp.Plane];
02432       cp.MCSuppEnDep+=vEnSupp[cp.Plane];
02433     }
02434   }
02435   else {
02436     MAXMSG("MeuCuts",Msg::kInfo,1)
02437       <<endl<<"Not extracting truth info, numDshs="<<numDshs
02438       <<", SimFlag="<<s.SimFlag<<endl;
02439   }
02440 }

void MeuCuts::ExtractTruthInfo ( const NtpStRecord ntp,
MeuSummary s,
std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 2445 of file MeuCuts.cxx.

References NtpMCDigiScintHit::dE, NtpStRecord::digihit, NtpMCDigiScintHit::dS, Msg::kDebug, Msg::kInfo, SimFlag::kMC, MAXMSG, NtpMCDigiScintHit::pE, NtpMCDigiScintHit::pId, NtpMCDigiScintHit::plane, Munits::s, and NtpMCDigiScintHit::strip.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

02447 {
02448   if (s.SimFlag!=SimFlag::kMC) {
02449     MAXMSG("MeuCuts",Msg::kInfo,1)
02450       <<endl<<"Not extracting truth info, SimFlag="<<s.SimFlag<<endl;
02451     return;
02452   }
02453   
02454   //initialise
02455   Float_t lowEn=999999;
02456   Float_t highEn=-1;
02457   Int_t lowEnPl=-1;
02458   Int_t highEnPl=-1;
02459   Int_t mainParticle=0;
02460   Int_t muon=13;
02461   Double_t B=0.133;// (m/GeV)
02462   
02463   //have a vector for efficiency (expensive to search plInfo for dshs)
02464   vector<Float_t> vEn(1000);
02465   vector<Float_t> vEnSupp(1000);
02466   
02467   TClonesArray& tcaDsh=(*ntp.digihit);
02468   Int_t numDshs=tcaDsh.GetEntries();
02469 
02470   //loop over dshs
02471   for (Int_t i=0;i<numDshs;i++){
02472     
02473     const NtpMCDigiScintHit* pdsh=
02474       dynamic_cast<NtpMCDigiScintHit*>(tcaDsh[i]);
02475     const NtpMCDigiScintHit& dsh=(*pdsh);
02476 
02477     MAXMSG("MeuCuts",Msg::kDebug,1000)
02478       <<"DSH: pl="<<dsh.plane<<", st="<<dsh.strip
02479       <<", pE="<<dsh.pE<<", dE="<<dsh.dE<<endl;
02480 
02481     //get the highest and lowest muon energy and associated planes
02482     if (abs(dsh.pId)==muon) {
02483       mainParticle=dsh.pId;
02484       if (dsh.pE>highEn) {
02485         highEn=dsh.pE;
02486         highEnPl=dsh.plane;
02487       }
02488       if (dsh.pE<lowEn) {
02489         lowEn=dsh.pE;
02490         lowEnPl=dsh.plane;
02491       }
02492     }
02493 
02494     Double_t birksSupp=1;//complete saturation
02495     if (dsh.dS!=0) birksSupp=1-(1./(1+B*(dsh.dE/dsh.dS)));
02496     else {
02497       MAXMSG("MeuCuts",Msg::kInfo,5)
02498         <<"Zero pathlength in DSH: dE="<<dsh.dE
02499         <<", id="<<dsh.pId<<endl;
02500     }
02501     Double_t suppEnDep=(1-birksSupp)*dsh.dE;
02502     vEnSupp[dsh.plane]+=suppEnDep;
02503     vEn[dsh.plane]+=dsh.dE;
02504   }
02505   
02506   if (numDshs>0) {
02507     //reset to -1 if not found to be consistent with highEn
02508     if (lowEn==999999) lowEn=-1;
02509     
02510     //set all the variables
02511     s.MCHighEn=highEn;
02512     s.MCLowEn=lowEn;
02513     s.MCParticleId=mainParticle;
02514     s.MCVtxPlane=highEnPl;
02515     s.MCEndPlane=lowEnPl;
02516     
02517     //now transfer the cache of variables to the map
02518     typedef map<Int_t,MeuHitInfo>::iterator iter;
02519     for (iter it=plInfo.begin();it!=plInfo.end();++it){
02520       MeuHitInfo& cp=it->second;
02521       cp.MCEnDep+=vEn[cp.Plane];
02522       cp.MCSuppEnDep+=vEnSupp[cp.Plane];
02523     }
02524   }
02525   else {
02526     MAXMSG("MeuCuts",Msg::kInfo,1)
02527       <<endl<<"Not extracting truth info, numDshs="<<numDshs
02528       <<", SimFlag="<<s.SimFlag<<endl;
02529   }
02530 }

void MeuCuts::FillBeamMonDetails ( const NtpBDLiteRecord bd,
MeuSummary s 
) const

Definition at line 574 of file MeuCuts.cxx.

References Munits::s, NtpBDLiteRecord::tor101, and NtpBDLiteRecord::tortgt.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl().

00576 {
00577   s.BDtortgt=bd.tortgt;
00578   s.BDtor101=bd.tor101;
00579 }

void MeuCuts::FillEnVsDist ( const MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 2535 of file MeuCuts.cxx.

References MeuHitInfo::Adc, MeuHitInfo::Adc1, MeuHitInfo::Adc2, Munits::cm, Msg::kDebug, MAXMSG, MSG, MeuHitInfo::NumDigits, MeuHitInfo::NumStrips, MeuHitInfo::Pe, MeuHitInfo::Pe1, MeuHitInfo::Pe2, MeuHitInfo::Plane, MeuHitInfo::PLCor, Munits::s, MeuHitInfo::SigCor, MeuHitInfo::SigCor1, MeuHitInfo::SigCor2, MeuHitInfo::SigLin, MeuHitInfo::SigLin1, MeuHitInfo::SigLin2, MeuHitInfo::SigMap, MeuHitInfo::SigMap1, MeuHitInfo::SigMap2, and MeuHitInfo::Y.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

02536 {
02537   //variable to turn on all the useful messages if required
02538   Msg::LogLevel_t logLevel=Msg::kDebug;
02539 
02540   Bool_t posDir=(s.EndPlane>s.VtxPlane);
02541   Float_t materialFromTrkEnd=0;
02542   //const Float_t material01Pl=(2.5+1)*Munits::cm;
02543   const Float_t material01Pl=(5.94)*Munits::cm;//including air gap
02544 
02545   static TProfile* pEnVsDist=0;
02546   static TProfile* pEnVsDist0=0;
02547   static TProfile* pEnVsDist0Cor=0;
02548   static TProfile* pEnVsDistNoEnd=0;
02549 
02550   //these are nothing to do with "time" but don't want to have a 
02551   //separate loop
02552   static TH1F* hSigMapWinPln=0;
02553   static TH1F* hSigMapAllPln=0;
02554   static TH1F* hSigCorWinPln=0;
02555   static TH1F* hSigCorAllPln=0;
02556   static TH1F* hSigLinWinPln=0;
02557   static TH1F* hSigLinAllPln=0;
02558   static TH1F* hAdcWinPln=0;
02559   static TH1F* hAdcAllPln=0;
02560   static TH1F* hPeWinPln=0;
02561   static TH1F* hPeAllPln=0;
02562   static TH1F* hDigitWinPln=0;
02563   static TH1F* hDigitAllPln=0;
02564   static TH1F* hStripWinPln=0;
02565   static TH1F* hStripAllPln=0;
02566 
02567   static TH1F* hSigMapWinPln1=0;
02568   static TH1F* hSigMapAllPln1=0;
02569   static TH1F* hSigCorWinPln1=0;
02570   static TH1F* hSigCorAllPln1=0;
02571   static TH1F* hSigLinWinPln1=0;
02572   static TH1F* hSigLinAllPln1=0;
02573   static TH1F* hAdcWinPln1=0;
02574   static TH1F* hAdcAllPln1=0;
02575   static TH1F* hPeWinPln1=0;
02576   static TH1F* hPeAllPln1=0;
02577   static TH1F* hDigitWinPln1=0;
02578   static TH1F* hDigitAllPln1=0;
02579   static TH1F* hStripWinPln1=0;
02580   static TH1F* hStripAllPln1=0;
02581 
02582   static TH1F* hSigMapWinPln2=0;
02583   static TH1F* hSigMapAllPln2=0;
02584   static TH1F* hSigCorWinPln2=0;
02585   static TH1F* hSigCorAllPln2=0;
02586   static TH1F* hSigLinWinPln2=0;
02587   static TH1F* hSigLinAllPln2=0;
02588   static TH1F* hAdcWinPln2=0;
02589   static TH1F* hAdcAllPln2=0;
02590   static TH1F* hPeWinPln2=0;
02591   static TH1F* hPeAllPln2=0;
02592   static TH1F* hDigitWinPln2=0;
02593   static TH1F* hDigitAllPln2=0;
02594   static TH1F* hStripWinPln2=0;
02595   static TH1F* hStripAllPln2=0;
02596 
02597 
02598   if (pEnVsDist==0) {
02599     pEnVsDist=new TProfile("pEnVsDist","pEnVsDist",60,0,
02600                            (60*material01Pl)/Munits::cm);
02601     pEnVsDistNoEnd=new TProfile("pEnVsDistNoEnd","pEnVsDistNoEnd",60,0,
02602                                 (60*material01Pl)/Munits::cm);
02603     pEnVsDist0=new TProfile("pEnVsDist0","pEnVsDist0",60,0,
02604                             (60*material01Pl)/Munits::cm);
02605     pEnVsDist0Cor=new TProfile("pEnVsDist0Cor","pEnVsDist0Cor",60,0,
02606                                (60*material01Pl)/Munits::cm);
02607     MSG("MeuCuts",logLevel)
02608       <<"Creating TProfile, pEnVsDist, max bin="
02609       <<(60*material01Pl)/Munits::cm<<endl;
02610     
02611     
02612     hSigMapWinPln=new TH1F("hSigMapWinPln","hSigMapWinPln",
02613                            20320,-320,20000);
02614     hSigMapWinPln->SetFillColor(0);
02615     hSigMapWinPln->SetTitle("SigMap of Planes in Window (in Slice)");
02616     hSigMapWinPln->GetXaxis()->SetTitle("SigMap");
02617     hSigMapWinPln->GetXaxis()->CenterTitle();
02618     //hSigMapWinPln->SetBit(TH1::kCanRebin);
02619     
02620     hSigMapAllPln=new TH1F("hSigMapAllPln","hSigMapAllPln",
02621                            20320,-320,20000);
02622     hSigMapAllPln->SetFillColor(0);
02623     hSigMapAllPln->SetTitle("SigMap of All Planes in Slice");
02624     hSigMapAllPln->GetXaxis()->SetTitle("SigMap");
02625     hSigMapAllPln->GetXaxis()->CenterTitle();
02626     //hSigMapAllPln->SetBit(TH1::kCanRebin);
02627     
02628 
02629     hSigCorWinPln=new TH1F("hSigCorWinPln","hSigCorWinPln",
02630                            20320,-320,20000);
02631     hSigCorWinPln->SetFillColor(0);
02632     hSigCorWinPln->SetTitle("SigCor of Planes in Window (in Slice)");
02633     hSigCorWinPln->GetXaxis()->SetTitle("SigCor");
02634     hSigCorWinPln->GetXaxis()->CenterTitle();
02635     //hSigCorWinPln->SetBit(TH1::kCanRebin);
02636     
02637     hSigCorAllPln=new TH1F("hSigCorAllPln","hSigCorAllPln",
02638                            20320,-320,20000);
02639     hSigCorAllPln->SetFillColor(0);
02640     hSigCorAllPln->SetTitle("SigCor of All Planes in Slice");
02641     hSigCorAllPln->GetXaxis()->SetTitle("SigCor");
02642     hSigCorAllPln->GetXaxis()->CenterTitle();
02643     //hSigCorAllPln->SetBit(TH1::kCanRebin);
02644     
02645     
02646     hSigLinWinPln=new TH1F("hSigLinWinPln","hSigLinWinPln",
02647                            20320,-320,20000);
02648     hSigLinWinPln->SetFillColor(0);
02649     hSigLinWinPln->SetTitle("SigLin of Planes in Window (in Slice)");
02650     hSigLinWinPln->GetXaxis()->SetTitle("SigLin");
02651     hSigLinWinPln->GetXaxis()->CenterTitle();
02652     //hSigLinWinPln->SetBit(TH1::kCanRebin);
02653     
02654     hSigLinAllPln=new TH1F("hSigLinAllPln","hSigLinAllPln",
02655                            20320,-320,20000);
02656     hSigLinAllPln->SetFillColor(0);
02657     hSigLinAllPln->SetTitle("SigLin of All Planes in Slice");
02658     hSigLinAllPln->GetXaxis()->SetTitle("SigLin");
02659     hSigLinAllPln->GetXaxis()->CenterTitle();
02660     //hSigLinAllPln->SetBit(TH1::kCanRebin);
02661     
02662     
02663     hAdcWinPln=new TH1F("hAdcWinPln","hAdcWinPln",
02664                            20320,-320,20000);
02665     hAdcWinPln->SetFillColor(0);
02666     hAdcWinPln->SetTitle("Adc of Planes in Window (in Slice)");
02667     hAdcWinPln->GetXaxis()->SetTitle("Adc");
02668     hAdcWinPln->GetXaxis()->CenterTitle();
02669     //hAdcWinPln->SetBit(TH1::kCanRebin);
02670     
02671     hAdcAllPln=new TH1F("hAdcAllPln","hAdcAllPln",
02672                            20320,-320,20000);
02673     hAdcAllPln->SetFillColor(0);
02674     hAdcAllPln->SetTitle("Adc of All Planes in Slice");
02675     hAdcAllPln->GetXaxis()->SetTitle("Adc");
02676     hAdcAllPln->GetXaxis()->CenterTitle();
02677     //hAdcAllPln->SetBit(TH1::kCanRebin);
02678     
02679     
02680     hPeWinPln=new TH1F("hPeWinPln","hPeWinPln",
02681                        10160,-4,250);
02682     hPeWinPln->SetFillColor(0);
02683     hPeWinPln->SetTitle("Pe of Planes in Window (in Slice)");
02684     hPeWinPln->GetXaxis()->SetTitle("Pe");
02685     hPeWinPln->GetXaxis()->CenterTitle();
02686     //hPeWinPln->SetBit(TH1::kCanRebin);
02687     
02688     hPeAllPln=new TH1F("hPeAllPln","hPeAllPln",
02689                        10160,-4,250);
02690     hPeAllPln->SetFillColor(0);
02691     hPeAllPln->SetTitle("Pe of All Planes in Slice");
02692     hPeAllPln->GetXaxis()->SetTitle("Pe");
02693     hPeAllPln->GetXaxis()->CenterTitle();
02694     //hPeAllPln->SetBit(TH1::kCanRebin);
02695     
02696 
02697     hDigitWinPln=new TH1F("hDigitWinPln","hDigitWinPln",
02698                           4020,-2,400);
02699     hDigitWinPln->SetFillColor(0);
02700     hDigitWinPln->SetTitle("Digits of Planes in Window (in Slice)");
02701     hDigitWinPln->GetXaxis()->SetTitle("Digits");
02702     hDigitWinPln->GetXaxis()->CenterTitle();
02703     hDigitWinPln->SetBit(TH1::kCanRebin);
02704     
02705     hDigitAllPln=new TH1F("hDigitAllPln","hDigitAllPln",
02706                           4020,-2,400);
02707     hDigitAllPln->SetFillColor(0);
02708     hDigitAllPln->SetTitle("Digits of All Planes in Slice");
02709     hDigitAllPln->GetXaxis()->SetTitle("Digits");
02710     hDigitAllPln->GetXaxis()->CenterTitle();
02711     //hDigitAllPln->SetBit(TH1::kCanRebin);
02712 
02713     hStripWinPln=new TH1F("hStripWinPln","hStripWinPln",
02714                           4020,-2,400);
02715     hStripWinPln->SetFillColor(0);
02716     hStripWinPln->SetTitle("Stp/Pln of Plns in Window");
02717     hStripWinPln->GetXaxis()->SetTitle("Strips");
02718     hStripWinPln->GetXaxis()->CenterTitle();
02719     hStripWinPln->SetBit(TH1::kCanRebin);
02720     
02721     hStripAllPln=new TH1F("hStripAllPln","hStripAllPln",
02722                           4020,-2,400);
02723     hStripAllPln->SetFillColor(0);
02724     hStripAllPln->SetTitle("Stp/Pln of All Plns in Trk");
02725     hStripAllPln->GetXaxis()->SetTitle("Strips");
02726     hStripAllPln->GetXaxis()->CenterTitle();
02727     //hStripAllPln->SetBit(TH1::kCanRebin);
02728 
02729 
02730     //stripend 1
02731     hSigMapWinPln1=new TH1F("hSigMapWinPln1","hSigMapWinPln1",
02732                            20320,-320,20000);
02733     hSigMapWinPln1->SetFillColor(0);
02734     hSigMapWinPln1->SetTitle("SigMap of Planes in Window (in Slice)");
02735     hSigMapWinPln1->GetXaxis()->SetTitle("SigMap");
02736     hSigMapWinPln1->GetXaxis()->CenterTitle();
02737     //hSigMapWinPln1->SetBit(TH1::kCanRebin);
02738     
02739     hSigMapAllPln1=new TH1F("hSigMapAllPln1","hSigMapAllPln1",
02740                            20320,-320,20000);
02741     hSigMapAllPln1->SetFillColor(0);
02742     hSigMapAllPln1->SetTitle("SigMap of All Planes in Slice");
02743     hSigMapAllPln1->GetXaxis()->SetTitle("SigMap");
02744     hSigMapAllPln1->GetXaxis()->CenterTitle();
02745     //hSigMapAllPln1->SetBit(TH1::kCanRebin);
02746     
02747 
02748     hSigCorWinPln1=new TH1F("hSigCorWinPln1","hSigCorWinPln1",
02749                            20320,-320,20000);
02750     hSigCorWinPln1->SetFillColor(0);
02751     hSigCorWinPln1->SetTitle("SigCor of Planes in Window (in Slice)");
02752     hSigCorWinPln1->GetXaxis()->SetTitle("SigCor");
02753     hSigCorWinPln1->GetXaxis()->CenterTitle();
02754     //hSigCorWinPln1->SetBit(TH1::kCanRebin);
02755     
02756     hSigCorAllPln1=new TH1F("hSigCorAllPln1","hSigCorAllPln1",
02757                            20320,-320,20000);
02758     hSigCorAllPln1->SetFillColor(0);
02759     hSigCorAllPln1->SetTitle("SigCor of All Planes in Slice");
02760     hSigCorAllPln1->GetXaxis()->SetTitle("SigCor");
02761     hSigCorAllPln1->GetXaxis()->CenterTitle();
02762     //hSigCorAllPln1->SetBit(TH1::kCanRebin);
02763     
02764     
02765     hSigLinWinPln1=new TH1F("hSigLinWinPln1","hSigLinWinPln1",
02766                            20320,-320,20000);
02767     hSigLinWinPln1->SetFillColor(0);
02768     hSigLinWinPln1->SetTitle("SigLin of Planes in Window (in Slice)");
02769     hSigLinWinPln1->GetXaxis()->SetTitle("SigLin");
02770     hSigLinWinPln1->GetXaxis()->CenterTitle();
02771     //hSigLinWinPln1->SetBit(TH1::kCanRebin);
02772     
02773     hSigLinAllPln1=new TH1F("hSigLinAllPln1","hSigLinAllPln1",
02774                            20320,-320,20000);
02775     hSigLinAllPln1->SetFillColor(0);
02776     hSigLinAllPln1->SetTitle("SigLin of All Planes in Slice");
02777     hSigLinAllPln1->GetXaxis()->SetTitle("SigLin");
02778     hSigLinAllPln1->GetXaxis()->CenterTitle();
02779     //hSigLinAllPln1->SetBit(TH1::kCanRebin);
02780     
02781     
02782     hAdcWinPln1=new TH1F("hAdcWinPln1","hAdcWinPln1",
02783                            20320,-320,20000);
02784     hAdcWinPln1->SetFillColor(0);
02785     hAdcWinPln1->SetTitle("Adc of Planes in Window (in Slice)");
02786     hAdcWinPln1->GetXaxis()->SetTitle("Adc");
02787     hAdcWinPln1->GetXaxis()->CenterTitle();
02788     //hAdcWinPln1->SetBit(TH1::kCanRebin);
02789     
02790     hAdcAllPln1=new TH1F("hAdcAllPln1","hAdcAllPln1",
02791                            20320,-320,20000);
02792     hAdcAllPln1->SetFillColor(0);
02793     hAdcAllPln1->SetTitle("Adc of All Planes in Slice");
02794     hAdcAllPln1->GetXaxis()->SetTitle("Adc");
02795     hAdcAllPln1->GetXaxis()->CenterTitle();
02796     //hAdcAllPln1->SetBit(TH1::kCanRebin);
02797     
02798     
02799     hPeWinPln1=new TH1F("hPeWinPln1","hPeWinPln1",
02800                        10160,-4,250);
02801     hPeWinPln1->SetFillColor(0);
02802     hPeWinPln1->SetTitle("Pe of Planes in Window (in Slice)");
02803     hPeWinPln1->GetXaxis()->SetTitle("Pe");
02804     hPeWinPln1->GetXaxis()->CenterTitle();
02805     //hPeWinPln1->SetBit(TH1::kCanRebin);
02806     
02807     hPeAllPln1=new TH1F("hPeAllPln1","hPeAllPln1",
02808                        10160,-4,250);
02809     hPeAllPln1->SetFillColor(0);
02810     hPeAllPln1->SetTitle("Pe of All Planes in Slice");
02811     hPeAllPln1->GetXaxis()->SetTitle("Pe");
02812     hPeAllPln1->GetXaxis()->CenterTitle();
02813     //hPeAllPln1->SetBit(TH1::kCanRebin);
02814     
02815 
02816     hDigitWinPln1=new TH1F("hDigitWinPln1","hDigitWinPln1",
02817                           4020,-2,400);
02818     hDigitWinPln1->SetFillColor(0);
02819     hDigitWinPln1->SetTitle("Digits of Planes in Window (in Slice)");
02820     hDigitWinPln1->GetXaxis()->SetTitle("Digits");
02821     hDigitWinPln1->GetXaxis()->CenterTitle();
02822     //hDigitWinPln1->SetBit(TH1::kCanRebin);
02823     
02824     hDigitAllPln1=new TH1F("hDigitAllPln1","hDigitAllPln1",
02825                           4020,-2,400);
02826     hDigitAllPln1->SetFillColor(0);
02827     hDigitAllPln1->SetTitle("Digits of All Planes in Slice");
02828     hDigitAllPln1->GetXaxis()->SetTitle("Digits");
02829     hDigitAllPln1->GetXaxis()->CenterTitle();
02830     //hDigitAllPln1->SetBit(TH1::kCanRebin);
02831 
02832     hStripWinPln1=new TH1F("hStripWinPln1","hStripWinPln1",
02833                           4020,-2,400);
02834     hStripWinPln1->SetFillColor(0);
02835     hStripWinPln1->SetTitle("Stp/Pln of Plns in Window");
02836     hStripWinPln1->GetXaxis()->SetTitle("Strips");
02837     hStripWinPln1->GetXaxis()->CenterTitle();
02838     //hStripWinPln1->SetBit(TH1::kCanRebin);
02839     
02840     hStripAllPln1=new TH1F("hStripAllPln1","hStripAllPln1",
02841                           4020,-2,400);
02842     hStripAllPln1->SetFillColor(0);
02843     hStripAllPln1->SetTitle("Stp/Pln of All Plns in Trk");
02844     hStripAllPln1->GetXaxis()->SetTitle("Strips");
02845     hStripAllPln1->GetXaxis()->CenterTitle();
02846     //hStripAllPln1->SetBit(TH1::kCanRebin);
02847 
02848 
02849     //stripend 2
02850     hSigMapWinPln2=new TH1F("hSigMapWinPln2","hSigMapWinPln2",
02851                            20320,-320,20000);
02852     hSigMapWinPln2->SetFillColor(0);
02853     hSigMapWinPln2->SetTitle("SigMap of Planes in Window (in Slice)");
02854     hSigMapWinPln2->GetXaxis()->SetTitle("SigMap");
02855     hSigMapWinPln2->GetXaxis()->CenterTitle();
02856     //hSigMapWinPln2->SetBit(TH1::kCanRebin);
02857     
02858     hSigMapAllPln2=new TH1F("hSigMapAllPln2","hSigMapAllPln2",
02859                            20320,-320,20000);
02860     hSigMapAllPln2->SetFillColor(0);
02861     hSigMapAllPln2->SetTitle("SigMap of All Planes in Slice");
02862     hSigMapAllPln2->GetXaxis()->SetTitle("SigMap");
02863     hSigMapAllPln2->GetXaxis()->CenterTitle();
02864     //hSigMapAllPln2->SetBit(TH1::kCanRebin);
02865     
02866 
02867     hSigCorWinPln2=new TH1F("hSigCorWinPln2","hSigCorWinPln2",
02868                            20320,-320,20000);
02869     hSigCorWinPln2->SetFillColor(0);
02870     hSigCorWinPln2->SetTitle("SigCor of Planes in Window (in Slice)");
02871     hSigCorWinPln2->GetXaxis()->SetTitle("SigCor");
02872     hSigCorWinPln2->GetXaxis()->CenterTitle();
02873     //hSigCorWinPln2->SetBit(TH1::kCanRebin);
02874     
02875     hSigCorAllPln2=new TH1F("hSigCorAllPln2","hSigCorAllPln2",
02876                            20320,-320,20000);
02877     hSigCorAllPln2->SetFillColor(0);
02878     hSigCorAllPln2->SetTitle("SigCor of All Planes in Slice");
02879     hSigCorAllPln2->GetXaxis()->SetTitle("SigCor");
02880     hSigCorAllPln2->GetXaxis()->CenterTitle();
02881     //hSigCorAllPln2->SetBit(TH1::kCanRebin);
02882     
02883     
02884     hSigLinWinPln2=new TH1F("hSigLinWinPln2","hSigLinWinPln2",
02885                            20320,-320,20000);
02886     hSigLinWinPln2->SetFillColor(0);
02887     hSigLinWinPln2->SetTitle("SigLin of Planes in Window (in Slice)");
02888     hSigLinWinPln2->GetXaxis()->SetTitle("SigLin");
02889     hSigLinWinPln2->GetXaxis()->CenterTitle();
02890     //hSigLinWinPln2->SetBit(TH1::kCanRebin);
02891     
02892     hSigLinAllPln2=new TH1F("hSigLinAllPln2","hSigLinAllPln2",
02893                            20320,-320,20000);
02894     hSigLinAllPln2->SetFillColor(0);
02895     hSigLinAllPln2->SetTitle("SigLin of All Planes in Slice");
02896     hSigLinAllPln2->GetXaxis()->SetTitle("SigLin");
02897     hSigLinAllPln2->GetXaxis()->CenterTitle();
02898     //hSigLinAllPln2->SetBit(TH1::kCanRebin);
02899     
02900     
02901     hAdcWinPln2=new TH1F("hAdcWinPln2","hAdcWinPln2",
02902                            20320,-320,20000);
02903     hAdcWinPln2->SetFillColor(0);
02904     hAdcWinPln2->SetTitle("Adc of Planes in Window (in Slice)");
02905     hAdcWinPln2->GetXaxis()->SetTitle("Adc");
02906     hAdcWinPln2->GetXaxis()->CenterTitle();
02907     //hAdcWinPln2->SetBit(TH1::kCanRebin);
02908     
02909     hAdcAllPln2=new TH1F("hAdcAllPln2","hAdcAllPln2",
02910                            20320,-320,20000);
02911     hAdcAllPln2->SetFillColor(0);
02912     hAdcAllPln2->SetTitle("Adc of All Planes in Slice");
02913     hAdcAllPln2->GetXaxis()->SetTitle("Adc");
02914     hAdcAllPln2->GetXaxis()->CenterTitle();
02915     //hAdcAllPln2->SetBit(TH1::kCanRebin);
02916     
02917     
02918     hPeWinPln2=new TH1F("hPeWinPln2","hPeWinPln2",
02919                        10160,-4,250);
02920     hPeWinPln2->SetFillColor(0);
02921     hPeWinPln2->SetTitle("Pe of Planes in Window (in Slice)");
02922     hPeWinPln2->GetXaxis()->SetTitle("Pe");
02923     hPeWinPln2->GetXaxis()->CenterTitle();
02924     //hPeWinPln2->SetBit(TH1::kCanRebin);
02925     
02926     hPeAllPln2=new TH1F("hPeAllPln2","hPeAllPln2",
02927                        10160,-4,250);
02928     hPeAllPln2->SetFillColor(0);
02929     hPeAllPln2->SetTitle("Pe of All Planes in Slice");
02930     hPeAllPln2->GetXaxis()->SetTitle("Pe");
02931     hPeAllPln2->GetXaxis()->CenterTitle();
02932     //hPeAllPln2->SetBit(TH1::kCanRebin);
02933     
02934 
02935     hDigitWinPln2=new TH1F("hDigitWinPln2","hDigitWinPln2",
02936                           4020,-2,400);
02937     hDigitWinPln2->SetFillColor(0);
02938     hDigitWinPln2->SetTitle("Digits of Planes in Window (in Slice)");
02939     hDigitWinPln2->GetXaxis()->SetTitle("Digits");
02940     hDigitWinPln2->GetXaxis()->CenterTitle();
02941     //hDigitWinPln2->SetBit(TH1::kCanRebin);
02942     
02943     hDigitAllPln2=new TH1F("hDigitAllPln2","hDigitAllPln2",
02944                           4020,-2,400);
02945     hDigitAllPln2->SetFillColor(0);
02946     hDigitAllPln2->SetTitle("Digits of All Planes in Slice");
02947     hDigitAllPln2->GetXaxis()->SetTitle("Digits");
02948     hDigitAllPln2->GetXaxis()->CenterTitle();
02949     //hDigitAllPln2->SetBit(TH1::kCanRebin);
02950 
02951     hStripWinPln2=new TH1F("hStripWinPln2","hStripWinPln2",
02952                           4020,-2,400);
02953     hStripWinPln2->SetFillColor(0);
02954     hStripWinPln2->SetTitle("Stp/Pln of Plns in Window");
02955     hStripWinPln2->GetXaxis()->SetTitle("Strips");
02956     hStripWinPln2->GetXaxis()->CenterTitle();
02957     //hStripWinPln2->SetBit(TH1::kCanRebin);
02958     
02959     hStripAllPln2=new TH1F("hStripAllPln2","hStripAllPln2",
02960                           4020,-2,400);
02961     hStripAllPln2->SetFillColor(0);
02962     hStripAllPln2->SetTitle("Stp/Pln of All Plns in Trk");
02963     hStripAllPln2->GetXaxis()->SetTitle("Strips");
02964     hStripAllPln2->GetXaxis()->CenterTitle();
02965     //hStripAllPln2->SetBit(TH1::kCanRebin);
02966   }
02967 
02968   //calculate energy deposition in the window
02969   if (s.EndPlane>=0){
02970     
02971     //get variables for loops
02972     //NOTE: start at the end of the track NOT the vtx
02973     Int_t pl=s.EndPlane;
02974     Int_t tmpVtxPlane=s.VtxPlane;
02975     if (posDir) tmpVtxPlane--;//make sure last plane is used
02976     else tmpVtxPlane++;
02977     
02978     //loop over the track starting at the end
02979     while (pl!=tmpVtxPlane){
02980       
02981       //cache the current cp
02982       const MeuHitInfo& cp=plInfo.find(pl)->second;
02983       Float_t plMaterial=cp.PLCor*material01Pl;
02984       //Float_t correctionFactor=0.0052*cp.Y+1;//fit to all y
02985       //the gradient changes with y, so do a simplistic split
02986       Float_t correctionFactor=0.0134*cp.Y+1;
02987       if (cp.Y<1) correctionFactor=0.005*cp.Y+1;
02988       Float_t meuSigMapCor=(cp.SigMap*correctionFactor)/cp.PLCor;
02989       Float_t meuSigMap=cp.SigMap/cp.PLCor;
02990       MAXMSG("MeuCuts",logLevel,100)
02991         <<"pl="<<pl<<", y="<<cp.Y<<", corFact="<<correctionFactor
02992         <<", meuSigMap="<<meuSigMap
02993         <<", meuSigMapCor="<<meuSigMapCor<<endl;
02994 
02995       //plot the value half way through the range of dE/dx it effectively
02996       //integrates over
02997       Float_t toPlotMaterial=plMaterial*0.5+materialFromTrkEnd;
02998 
02999       //put a check on the crazy brems and cut out the really steep ones
03000       //can also get high landau-tail events in individual planes
03001       if (s.WinSigMap>0 && s.WinSigMap<2000 &&
03002           fabs(s.WinAvCosThetaZ)>0.5 &&
03003           s.TotalMatTraversed>3 &&//material traversed more than 3 m
03004           cp.SigMap/cp.PLCor<3000){//3000 is 8 sigma from the peak
03005         
03006         pEnVsDist->Fill((toPlotMaterial/Munits::cm),meuSigMap);
03007         
03008         //fill using 0 for the first pl
03009         //don't try and get an average position
03010         pEnVsDist0->Fill((materialFromTrkEnd/Munits::cm),meuSigMap);
03011         pEnVsDist0Cor->Fill((materialFromTrkEnd/Munits::cm),
03012                             meuSigMapCor);
03013 
03014         if (pl!=s.EndPlane) {
03015           pEnVsDistNoEnd->Fill((toPlotMaterial/Munits::cm),meuSigMap);
03016         }
03017       }
03018       materialFromTrkEnd+=plMaterial;
03019 
03020       MAXMSG("MeuCuts",logLevel,1000)
03021         <<"plMat="<<plMaterial
03022         <<", matTrk="<<materialFromTrkEnd
03023         <<", toPlotMat="<<(toPlotMaterial/Munits::cm)
03024         <<"meuSigMap="<<meuSigMap<<", PLCor="<<cp.PLCor<<endl;
03025 
03026 
03028       //section to make plots of all hit strip distributions
03029       hSigMapAllPln->Fill(cp.SigMap);
03030       hSigCorAllPln->Fill(cp.SigCor);
03031       hSigLinAllPln->Fill(cp.SigLin);
03032       hAdcAllPln->Fill(cp.Adc);
03033       hPeAllPln->Fill(cp.Pe);
03034       hDigitAllPln->Fill(cp.NumDigits);
03035       hStripAllPln->Fill(cp.NumStrips);
03036 
03037       hSigMapAllPln1->Fill(cp.SigMap1);
03038       hSigCorAllPln1->Fill(cp.SigCor1);
03039       hSigLinAllPln1->Fill(cp.SigLin1);
03040       hAdcAllPln1->Fill(cp.Adc1);
03041       hPeAllPln1->Fill(cp.Pe1);
03042       //hDigitAllPln1->Fill(cp.NumDigits);
03043       //hStripAllPln1->Fill(cp.NumStrips);
03044 
03045       hSigMapAllPln2->Fill(cp.SigMap2);
03046       hSigCorAllPln2->Fill(cp.SigCor2);
03047       hSigLinAllPln2->Fill(cp.SigLin2);
03048       hAdcAllPln2->Fill(cp.Adc2);
03049       hPeAllPln2->Fill(cp.Pe2);
03050       //hDigitAllPln2->Fill(cp.NumDigits);
03051       //hStripAllPln2->Fill(cp.NumStrips);
03052 
03053 
03054       //check if plane is in window
03055       if ((cp.Plane>=s.WinVtxSidePl && cp.Plane<=s.WinStopSidePl) ||
03056           (cp.Plane<=s.WinVtxSidePl && cp.Plane>=s.WinStopSidePl)) {
03057         hSigMapWinPln->Fill(cp.SigMap);
03058         hSigCorWinPln->Fill(cp.SigCor);
03059         hSigLinWinPln->Fill(cp.SigLin);
03060         hAdcWinPln->Fill(cp.Adc);
03061         hPeWinPln->Fill(cp.Pe);
03062         hDigitWinPln->Fill(cp.NumDigits);
03063         hStripWinPln->Fill(cp.NumStrips);
03064         
03065         hSigMapWinPln1->Fill(cp.SigMap1);
03066         hSigCorWinPln1->Fill(cp.SigCor1);
03067         hSigLinWinPln1->Fill(cp.SigLin1);
03068         hAdcWinPln1->Fill(cp.Adc1);
03069         hPeWinPln1->Fill(cp.Pe1);
03070         //hDigitWinPln1->Fill(cp.NumDigits);
03071         //hStripWinPln1->Fill(cp.NumStrips);
03072         
03073         hSigMapWinPln2->Fill(cp.SigMap2);
03074         hSigCorWinPln2->Fill(cp.SigCor2);
03075         hSigLinWinPln2->Fill(cp.SigLin2);
03076         hAdcWinPln2->Fill(cp.Adc2);
03077         hPeWinPln2->Fill(cp.Pe2);
03078         //hDigitWinPln2->Fill(cp.NumDigits);
03079         //hStripWinPln2->Fill(cp.NumStrips);
03080       }
03081 
03082       //increment the plane
03083       if (posDir) pl--;//working backwards from end to vtx
03084       else pl++;
03085     }
03086   }
03087 }

void MeuCuts::FillEnVsDist2 ( const MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 3092 of file MeuCuts.cxx.

References MeuReco::CheckDeepDistToEdge(), Munits::cm, Msg::kDebug, MAXMSG, MSG, MeuHitInfo::Plane, MeuHitInfo::PLCor, Munits::s, MeuHitInfo::SigMap, MeuHitInfo::Strip, and MeuHitInfo::Y.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

03093 {
03094   //variable to turn on all the useful messages if required
03095   Msg::LogLevel_t logLevel=Msg::kDebug;
03096 
03097   Bool_t posDir=(s.EndPlane>s.VtxPlane);
03098   Float_t materialFromTrkEnd=0;
03099   //const Float_t material01Pl=(2.5+1)*Munits::cm;
03100   const Float_t material01Pl=(5.94)*Munits::cm;//including air gap
03101   
03102   if (s.TotalMatTraversed<(60*material01Pl) ||
03103       fabs(s.WinAvCosThetaZ)<0.3) {
03104     MAXMSG("MeuCuts",Msg::kDebug,10)
03105       <<"MatTrav="<<s.TotalMatTraversed/Munits::cm<<" cm, 60 planes="
03106       <<(60*material01Pl)/Munits::cm<<" cm"
03107       <<", cosThZ="<<s.WinAvCosThetaZ<<endl;
03108     return;
03109   }
03110 
03112   //check that all hits on track up to 60 planes are deeply contained
03113   Float_t containDisttoEdge=0.1;//fiducial distance from edge for win
03114   Int_t pl2=s.EndPlane;
03115   Int_t tmpVtxPlane2=s.VtxPlane;
03116   if (posDir) tmpVtxPlane2--;//make sure last plane is used
03117   else tmpVtxPlane2++;
03118 
03119   Float_t matTrav=0;
03120   Bool_t allDeep=true;
03121   
03122   //loop over the track starting at the end
03123   while (pl2!=tmpVtxPlane2){
03124 
03125     //cache the current cp
03126     const MeuHitInfo& cp=plInfo.find(pl2)->second;
03127     Float_t plMaterial=cp.PLCor*material01Pl;
03128     matTrav+=plMaterial;
03129 
03130     static MeuReco reco;
03131     Float_t distToEdge=reco.CheckDeepDistToEdge(cp);
03132     
03133     //check that the last 60 planes of track are deeply contained
03134     if (matTrav<(60*material01Pl)){
03135       if(distToEdge<containDisttoEdge) {
03136         allDeep=false;
03137         MAXMSG("MeuCuts",Msg::kDebug,500)
03138           <<"NOT DEEPLY CONTAINED: pl="<<cp.Plane<<", st="<<cp.Strip
03139           <<", d="<<distToEdge<<", bool="<<allDeep<<endl;
03140         return;
03141       }
03142     }
03143 
03144     MAXMSG("MeuCuts",Msg::kDebug,500)
03145       <<"pl="<<pl2<<", matTrav="<<matTrav<<", plMat="<<plMaterial
03146       <<", d="<<distToEdge<<", bool="<<allDeep<<endl;
03147     
03148     //increment the plane
03149     if (posDir) pl2--;//working backwards from end to vtx
03150     else pl2++;
03151   }
03152   
03154   static TProfile* pEnVsDist2=0;
03155   static TProfile* pEnVsDist20=0;
03156   static TProfile* pEnVsDist20Cor=0;
03157   static TProfile* pEnVsDist2NoEnd=0;
03158   static TH1F* hEnVsDistMeu=0;
03159   if (pEnVsDist2==0) {
03160     pEnVsDist2=new TProfile("pEnVsDist2","pEnVsDist2",60,0,
03161                            (60*material01Pl)/Munits::cm);
03162     pEnVsDist2NoEnd=new TProfile("pEnVsDist2NoEnd","pEnVsDist2NoEnd",60,0,
03163                                 (60*material01Pl)/Munits::cm);
03164     pEnVsDist20=new TProfile("pEnVsDist20","pEnVsDist20",60,0,
03165                             (60*material01Pl)/Munits::cm);
03166     pEnVsDist20Cor=new TProfile("pEnVsDist20Cor","pEnVsDist20Cor",60,0,
03167                                (60*material01Pl)/Munits::cm);
03168     hEnVsDistMeu=new TH1F("hEnVsDistMeu","hEnVsDistMeu",3001,-1,3000);
03169     hEnVsDistMeu->SetFillColor(0);
03170     hEnVsDistMeu->SetTitle("MEU in SigMap Units");
03171     hEnVsDistMeu->GetXaxis()->SetTitle("MEU");
03172     hEnVsDistMeu->GetXaxis()->CenterTitle();
03173     
03174     MSG("MeuCuts",logLevel)
03175       <<"Creating TProfile, pEnVsDist2, max bin="
03176       <<(60*material01Pl)/Munits::cm<<endl;
03177   }
03178 
03179   //calculate energy deposition in the window
03180   if (s.EndPlane>=0){
03181     
03182     hEnVsDistMeu->Fill(s.WinSigMap);//use to test if meu is good
03183     
03184     //get variables for loops
03185     //NOTE: start at the end of the track NOT the vtx
03186     Int_t pl=s.EndPlane;
03187     Int_t tmpVtxPlane=s.VtxPlane;
03188     if (posDir) tmpVtxPlane--;//make sure last plane is used
03189     else tmpVtxPlane++;
03190     
03191     //loop over the track starting at the end
03192     while (pl!=tmpVtxPlane){
03193       
03194       //cache the current cp
03195       const MeuHitInfo& cp=plInfo.find(pl)->second;
03196       Float_t plMaterial=cp.PLCor*material01Pl;
03197       //Float_t correctionFactor=0.0052*cp.Y+1;//fit to all y
03198       //the gradient changes with y, so do a simplistic split
03199       Float_t correctionFactor=0.0134*cp.Y+1;
03200       if (cp.Y<1) correctionFactor=0.005*cp.Y+1;
03201       Float_t meuSigMapCor=(cp.SigMap*correctionFactor)/cp.PLCor;
03202       Float_t meuSigMap=cp.SigMap/cp.PLCor;
03203       MAXMSG("MeuCuts",logLevel,100)
03204         <<"pl="<<pl<<", y="<<cp.Y<<", corFact="<<correctionFactor
03205         <<", meuSigMap="<<meuSigMap
03206         <<", meuSigMapCor="<<meuSigMapCor<<endl;
03207 
03208       //plot the value half way through the range of dE/dx it effectively
03209       //integrates over
03210       Float_t toPlotMaterial=plMaterial*0.5+materialFromTrkEnd;
03211 
03212       //put a check on the crazy brems and cut out the really steep ones
03213       //can also get high landau-tail events in individual planes
03214       if (s.WinSigMap>0 && s.WinSigMap<2000 &&
03215           fabs(s.WinAvCosThetaZ)>0.5 &&
03216           s.TotalMatTraversed>3 &&//material traversed more than 3 m
03217           cp.SigMap/cp.PLCor<3000){//3000 is 8 sigma from the peak
03218         
03219         pEnVsDist2->Fill((toPlotMaterial/Munits::cm),meuSigMap);
03220         
03221         //fill using 0 for the first pl
03222         //don't try and get an average position
03223         pEnVsDist20->Fill((materialFromTrkEnd/Munits::cm),meuSigMap);
03224         pEnVsDist20Cor->Fill((materialFromTrkEnd/Munits::cm),
03225                             meuSigMapCor);
03226 
03227         if (pl!=s.EndPlane) {
03228           pEnVsDist2NoEnd->Fill((toPlotMaterial/Munits::cm),meuSigMap);
03229         }
03230       }
03231       materialFromTrkEnd+=plMaterial;
03232 
03233       MAXMSG("MeuCuts",logLevel,1000)
03234         <<"plMat="<<plMaterial
03235         <<", matTrk="<<materialFromTrkEnd
03236         <<", toPlotMat="<<(toPlotMaterial/Munits::cm)
03237         <<"meuSigMap="<<meuSigMap<<", PLCor="<<cp.PLCor<<endl;
03238       
03239       //increment the plane
03240       if (posDir) pl--;//working backwards from end to vtx
03241       else pl++;
03242     }
03243   }
03244 }

void MeuCuts::FillSTSumDetails ( const AtmosEvent ev,
MeuSummary s 
) const

Definition at line 551 of file MeuCuts.cxx.

References Detector::GetEntries(), SimFlag::kData, Detector::kFar, SimFlag::kMC, AtmosEvent::NanoSec, AtmosEvent::NScintHits, AtmosEvent::Run, Munits::s, AtmosEvent::Snarl, AtmosEvent::StripList, AtmosEvent::SubRun, AtmosEvent::TrigSrc, and AtmosEvent::UnixTime.

00553 {
00554   s.Run=ev.Run;
00555   s.SubRun=ev.SubRun;
00556   s.Snarl=ev.Snarl;
00557   s.TimeSec=ev.UnixTime;
00558   s.TimeNanoSec=ev.NanoSec;
00559   //s.NStrip=tcaStp.GetEntries();
00560   s.NStrip=(*ev.StripList).GetEntries();
00561   s.Detector=Detector::kFar;//always kFar for AtmosEvent
00562   //have to work out the simflag
00563   if (ev.NScintHits<=0) s.SimFlag=SimFlag::kData;
00564   else s.SimFlag=SimFlag::kMC;
00565   s.TrigSrc=ev.TrigSrc;
00566 
00567   //these don't matter for the FD
00568   s.Evt=-1;
00569   s.Slc=-1;
00570 }

void MeuCuts::FillSTSumDetails ( const NtpStRecord ntp,
MeuSummary s,
Int_t  evt,
Int_t  slc 
) const

Definition at line 502 of file MeuCuts.cxx.

References NtpStRecord::dataquality, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), VldTimeStamp::GetNanoSec(), RecDataHeader::GetRun(), RecDataHeader::GetRunType(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), RecPhysicsHeader::GetSnarl(), RecDataHeader::GetSubRun(), VldContext::GetTimeStamp(), RecPhysicsHeader::GetTrigSrc(), RecHeader::GetVldContext(), RecRecordImp< T >::GetVldContext(), Msg::kInfo, SimFlag::kMC, Detector::kNear, Msg::kWarning, MAXMSG, NtpStRecord::mc, Munits::s, and NtpStRecord::slc.

Referenced by MeuAnalysis::BasicReco(), MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::N_1Plots(), MeuAnalysis::SnarlList(), and MeuAnalysis::SpillPlots().

00504 {
00505   const RecCandHeader& rec=ntp.GetHeader();
00506   TClonesArray& slcTca=(*ntp.slc);
00507 
00508   s.Run=rec.GetRun();
00509   s.SubRun=rec.GetSubRun();
00510   s.Snarl=rec.GetSnarl();
00511   s.TimeSec=ntp.GetVldContext()->GetTimeStamp().GetSec();
00512   s.TimeNanoSec=rec.GetVldContext().GetTimeStamp().GetNanoSec();
00513   //s.NStrip=tcaStp.GetEntries();
00514   s.NStrip=dynamic_cast<NtpSRSlice*>(slcTca[slc])->nstrip;
00515   s.Detector=rec.GetVldContext().GetDetector();
00516   s.SimFlag=rec.GetVldContext().GetSimFlag();
00517   s.TrigSrc=rec.GetTrigSrc();
00518   s.RunType=rec.GetRunType();
00519 
00520   s.Evt=evt;
00521   s.Slc=slc;
00522 
00523   //a hack to correct the trigger bit of the cosmic MC in the ND
00524   if (s.SimFlag==SimFlag::kMC && s.Detector==Detector::kNear) {
00525     //the cosmic MC doesn't have any entries
00526     TClonesArray& mcTca=*ntp.mc;
00527     MAXMSG("MeuAnalysis",Msg::kInfo,1)
00528       <<"Number of entries in NtpMCTruth="<<mcTca.GetEntries()
00529       <<", if >0 then spill MC"<<endl;
00530     if (mcTca.GetEntries()==0){ 
00531       MAXMSG("MeuAnalysis",Msg::kWarning,5)
00532         <<"Performing hack to correct the fTrigSrc of"
00533         <<" ND cosmic MC, was="
00534         <<s.TrigSrc<<", setting to 4"<<endl;
00535       s.TrigSrc=4;//a plane trigger
00536     }
00537   }
00538 
00539   //apply data quality cuts to FD data, Tingjun 03/27/07
00540   if (this->IsGoodDataQuality(ntp)) s.GoodDataQuality = true;
00541   else s.GoodDataQuality = false;
00542 
00543   NtpSRDataQuality dataqua = ntp.dataquality;
00544   s.CrateMask = dataqua.cratemask;
00545   s.BusyChips = dataqua.busychips;
00546   s.ColdChips = dataqua.coldchips;
00547 }

void MeuCuts::FillSTSumRecoDetails ( MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo 
) const

Definition at line 584 of file MeuCuts.cxx.

References Munits::s.

Referenced by MeuAnalysis::BasicReco(), MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

00585 {
00586   map<Int_t,MeuHitInfo>::const_iterator 
00587     it=plInfo.find(s.VtxPlane);
00588   if (it!=plInfo.end()){
00589     const MeuHitInfo& cp=it->second;
00590     s.VtxX=cp.X;
00591     s.VtxY=cp.Y;
00592     s.VtxZ=cp.Z;
00593   }
00594   it=plInfo.find(s.EndPlane);
00595   if (it!=plInfo.end()){
00596     const MeuHitInfo& cp=it->second;
00597     s.EndX=cp.X;
00598     s.EndY=cp.Y;
00599     s.EndZ=cp.Z;
00600   }
00601     
00602   it=plInfo.find(s.WinVtxSidePl);
00603   if (it!=plInfo.end()){
00604     const MeuHitInfo& cp=it->second;
00605     s.WinVtxSideView=cp.View;
00606     s.WinVtxSideX=cp.X;
00607     s.WinVtxSideY=cp.Y;
00608     s.WinVtxSideZ=cp.Z;
00609     s.WinVtxSideTPos=cp.TPos;
00610     s.WinVtxSideLPos=cp.LPos;
00611     s.WinVtxSideStrip=cp.Strip;
00612   }
00613 
00614   it=plInfo.find(s.WinStopSidePl);
00615   if (it!=plInfo.end()){
00616     const MeuHitInfo& cp=it->second;
00617     s.WinStopSideView=cp.View;
00618     s.WinStopSideX=cp.X;
00619     s.WinStopSideY=cp.Y;
00620     s.WinStopSideZ=cp.Z;
00621     s.WinStopSideTPos=cp.TPos;
00622     s.WinStopSideLPos=cp.LPos;
00623     s.WinStopSideStrip=cp.Strip;
00624   }
00625 }

void MeuCuts::FillTimeHistos ( const NtpStRecord ntp,
const NtpSREvent evt,
const MeuSummary s 
) const

Definition at line 629 of file MeuCuts.cxx.

References Msg::kDebug, Msg::kInfo, MAXMSG, MSG, Munits::ns, NtpSREvent::ntrack, Munits::s, NtpSREvent::slc, NtpStRecord::slc, NtpStRecord::stp, NtpSRStrip::time0, NtpSRStrip::time1, NtpSREvent::trk, and NtpStRecord::trk.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

00632 {
00633   
00634   static TH1F* hTimeLength=0;
00635   static TH1F* hTimeBefore=0;
00636   static TH1F* hTimeAfter=0;
00637 
00638   static TH1F* hSlcTimeLength=0;
00639   static TH1F* hSlcTimeBefore=0;
00640   static TH1F* hSlcTimeAfter=0;
00641 
00642   static TH1F* hTrkTimeLength=0;
00643   static TH1F* hTrkTimeBefore=0;
00644   static TH1F* hTrkTimeAfter=0;
00645 
00646   static TH1F* hMedianTrkSlcDiff=0;
00647 
00648   static TProfile* pAdcVsTimeCut=0;
00649   static TProfile* pSigCorVsTimeCut=0;
00650   
00651   //these are nothing to do with "time" but don't want to have a 
00652   //separate loop
00653   static TH1F* hSigMapWinStp=0;
00654   static TH1F* hSigMapAllStp=0;
00655   static TH1F* hSigCorWinStp=0;
00656   static TH1F* hSigCorAllStp=0;
00657   static TH1F* hSigLinWinStp=0;
00658   static TH1F* hSigLinAllStp=0;
00659   static TH1F* hAdcWinStp=0;
00660   static TH1F* hAdcAllStp=0;
00661   static TH1F* hPeWinStp=0;
00662   static TH1F* hPeAllStp=0;
00663   static TH1F* hDigitWinStp=0;
00664   static TH1F* hDigitAllStp=0;
00665 
00666   static TH1F* hSigMapWinStp1=0;
00667   static TH1F* hSigMapAllStp1=0;
00668   static TH1F* hSigCorWinStp1=0;
00669   static TH1F* hSigCorAllStp1=0;
00670   static TH1F* hSigLinWinStp1=0;
00671   static TH1F* hSigLinAllStp1=0;
00672   static TH1F* hAdcWinStp1=0;
00673   static TH1F* hAdcAllStp1=0;
00674   static TH1F* hPeWinStp1=0;
00675   static TH1F* hPeAllStp1=0;
00676   static TH1F* hDigitWinStp1=0;
00677   static TH1F* hDigitAllStp1=0;
00678 
00679   static TH1F* hSigMapWinStp2=0;
00680   static TH1F* hSigMapAllStp2=0;
00681   static TH1F* hSigCorWinStp2=0;
00682   static TH1F* hSigCorAllStp2=0;
00683   static TH1F* hSigLinWinStp2=0;
00684   static TH1F* hSigLinAllStp2=0;
00685   static TH1F* hAdcWinStp2=0;
00686   static TH1F* hAdcAllStp2=0;
00687   static TH1F* hPeWinStp2=0;
00688   static TH1F* hPeAllStp2=0;
00689   static TH1F* hDigitWinStp2=0;
00690   static TH1F* hDigitAllStp2=0;
00691 
00692   if (hTimeLength==0) {
00693     MSG("MeuCuts",Msg::kDebug)
00694       <<"Creating time histos..."<<endl;
00695     
00696     hTimeLength=new TH1F("hTimeLength","hTimeLength",10000,-100,50000);
00697     hTimeLength->SetFillColor(0);
00698     hTimeLength->SetTitle("Snarl Length in Time");
00699     hTimeLength->GetXaxis()->SetTitle("Time (ns)");
00700     hTimeLength->GetXaxis()->CenterTitle();
00701     
00702     hTimeBefore=new TH1F("hTimeBefore","hTimeBefore",10000,-100,50000);
00703     hTimeBefore->SetFillColor(0);
00704     hTimeBefore->SetTitle("Time Between Event and First Hit");
00705     hTimeBefore->GetXaxis()->SetTitle("Time (ns)");
00706     hTimeBefore->GetXaxis()->CenterTitle();
00707     
00708     hTimeAfter=new TH1F("hTimeAfter","hTimeAfter",10000,-100,50000);
00709     hTimeAfter->SetFillColor(0);
00710     hTimeAfter->SetTitle("Time Between Event and Last Hit");
00711     hTimeAfter->GetXaxis()->SetTitle("Time (ns)");
00712     hTimeAfter->GetXaxis()->CenterTitle();
00713 
00714     hSlcTimeLength=new TH1F
00715       ("hSlcTimeLength","hSlcTimeLength",10000,-100,50000);
00716     hSlcTimeLength->SetFillColor(0);
00717     hSlcTimeLength->SetTitle("Slice Length in Time");
00718     hSlcTimeLength->GetXaxis()->SetTitle("Time (ns)");
00719     hSlcTimeLength->GetXaxis()->CenterTitle();
00720     
00721     hSlcTimeBefore=new TH1F
00722       ("hSlcTimeBefore","hSlcTimeBefore",10000,-100,50000);
00723     hSlcTimeBefore->SetFillColor(0);
00724     hSlcTimeBefore->SetTitle("Time Between Event and First Hit in Slice");
00725     hSlcTimeBefore->GetXaxis()->SetTitle("Time (ns)");
00726     hSlcTimeBefore->GetXaxis()->CenterTitle();
00727     
00728     hSlcTimeAfter=new TH1F
00729       ("hSlcTimeAfter","hSlcTimeAfter",10000,-100,50000);
00730     hSlcTimeAfter->SetFillColor(0);
00731     hSlcTimeAfter->SetTitle("Time Between Event and Last Hit in Slice");
00732     hSlcTimeAfter->GetXaxis()->SetTitle("Time (ns)");
00733     hSlcTimeAfter->GetXaxis()->CenterTitle();
00734 
00735     hTrkTimeLength=new TH1F
00736       ("hTrkTimeLength","hTrkTimeLength",10000,-100,50000);
00737     hTrkTimeLength->SetFillColor(0);
00738     hTrkTimeLength->SetTitle("Track Length in Time");
00739     hTrkTimeLength->GetXaxis()->SetTitle("Time (ns)");
00740     hTrkTimeLength->GetXaxis()->CenterTitle();
00741     
00742     hTrkTimeBefore=new TH1F
00743       ("hTrkTimeBefore","hTrkTimeBefore",10000,-100,50000);
00744     hTrkTimeBefore->SetFillColor(0);
00745     hTrkTimeBefore->SetTitle("Time Between Event and First Tracked Hit");
00746     hTrkTimeBefore->GetXaxis()->SetTitle("Time (ns)");
00747     hTrkTimeBefore->GetXaxis()->CenterTitle();
00748     
00749     hTrkTimeAfter=new TH1F
00750       ("hTrkTimeAfter","hTrkTimeAfter",10000,-100,50000);
00751     hTrkTimeAfter->SetFillColor(0);
00752     hTrkTimeAfter->SetTitle("Time Between Event and Last Tracked Hit");
00753     hTrkTimeAfter->GetXaxis()->SetTitle("Time (ns)");
00754     hTrkTimeAfter->GetXaxis()->CenterTitle();
00755 
00756     hMedianTrkSlcDiff=new TH1F
00757       ("hMedianTrkSlcDiff","hMedianTrkSlcDiff",10000,-3000,3000);
00758     hMedianTrkSlcDiff->SetFillColor(0);
00759     hMedianTrkSlcDiff->SetTitle("Diff. between Median Slc and Median Trk Time");
00760     hMedianTrkSlcDiff->GetXaxis()->SetTitle("Time (ns)");
00761     hMedianTrkSlcDiff->GetXaxis()->CenterTitle();
00762 
00763     
00764 
00765     pAdcVsTimeCut=new TProfile("pAdcVsTimeCut",
00766                                "pAdcVsTimeCut",12,-100,11*100);
00767     pAdcVsTimeCut->GetXaxis()->SetTitle("Time-Evt Time");
00768     pAdcVsTimeCut->GetXaxis()->CenterTitle();
00769     pAdcVsTimeCut->GetYaxis()->SetTitle("Average Adc");
00770     pAdcVsTimeCut->GetYaxis()->CenterTitle();
00771     
00772     pSigCorVsTimeCut=new TProfile("pSigCorVsTimeCut",
00773                                   "pSigCorVsTimeCut",12,-100,11*100);
00774     pSigCorVsTimeCut->GetXaxis()->SetTitle("Time-Evt Time");
00775     pSigCorVsTimeCut->GetXaxis()->CenterTitle();
00776     pSigCorVsTimeCut->GetYaxis()->SetTitle("Average SigCor");
00777     pSigCorVsTimeCut->GetYaxis()->CenterTitle();
00778 
00779 
00780 
00781 
00782     hSigMapWinStp=new TH1F("hSigMapWinStp","hSigMapWinStp",
00783                            20320,-320,20000);
00784     hSigMapWinStp->SetFillColor(0);
00785     hSigMapWinStp->SetTitle("SigMap of Strips in Window (in Slice)");
00786     hSigMapWinStp->GetXaxis()->SetTitle("SigMap");
00787     hSigMapWinStp->GetXaxis()->CenterTitle();
00788     //hSigMapWinStp->SetBit(TH1::kCanRebin);
00789     
00790     hSigMapAllStp=new TH1F("hSigMapAllStp","hSigMapAllStp",
00791                            20320,-320,20000);
00792     hSigMapAllStp->SetFillColor(0);
00793     hSigMapAllStp->SetTitle("SigMap of All Strips in Slice");
00794     hSigMapAllStp->GetXaxis()->SetTitle("SigMap");
00795     hSigMapAllStp->GetXaxis()->CenterTitle();
00796     //hSigMapAllStp->SetBit(TH1::kCanRebin);
00797     
00798 
00799     hSigCorWinStp=new TH1F("hSigCorWinStp","hSigCorWinStp",
00800                            20320,-320,20000);
00801     hSigCorWinStp->SetFillColor(0);
00802     hSigCorWinStp->SetTitle("SigCor of Strips in Window (in Slice)");
00803     hSigCorWinStp->GetXaxis()->SetTitle("SigCor");
00804     hSigCorWinStp->GetXaxis()->CenterTitle();
00805     //hSigCorWinStp->SetBit(TH1::kCanRebin);
00806     
00807     hSigCorAllStp=new TH1F("hSigCorAllStp","hSigCorAllStp",
00808                            20320,-320,20000);
00809     hSigCorAllStp->SetFillColor(0);
00810     hSigCorAllStp->SetTitle("SigCor of All Strips in Slice");
00811     hSigCorAllStp->GetXaxis()->SetTitle("SigCor");
00812     hSigCorAllStp->GetXaxis()->CenterTitle();
00813     //hSigCorAllStp->SetBit(TH1::kCanRebin);
00814     
00815     
00816     hSigLinWinStp=new TH1F("hSigLinWinStp","hSigLinWinStp",
00817                            20320,-320,20000);
00818     hSigLinWinStp->SetFillColor(0);
00819     hSigLinWinStp->SetTitle("SigLin of Strips in Window (in Slice)");
00820     hSigLinWinStp->GetXaxis()->SetTitle("SigLin");
00821     hSigLinWinStp->GetXaxis()->CenterTitle();
00822     //hSigLinWinStp->SetBit(TH1::kCanRebin);
00823     
00824     hSigLinAllStp=new TH1F("hSigLinAllStp","hSigLinAllStp",
00825                            20320,-320,20000);
00826     hSigLinAllStp->SetFillColor(0);
00827     hSigLinAllStp->SetTitle("SigLin of All Strips in Slice");
00828     hSigLinAllStp->GetXaxis()->SetTitle("SigLin");
00829     hSigLinAllStp->GetXaxis()->CenterTitle();
00830     //hSigLinAllStp->SetBit(TH1::kCanRebin);
00831     
00832     
00833     hAdcWinStp=new TH1F("hAdcWinStp","hAdcWinStp",
00834                            20320,-320,20000);
00835     hAdcWinStp->SetFillColor(0);
00836     hAdcWinStp->SetTitle("Adc of Strips in Window (in Slice)");
00837     hAdcWinStp->GetXaxis()->SetTitle("Adc");
00838     hAdcWinStp->GetXaxis()->CenterTitle();
00839     //hAdcWinStp->SetBit(TH1::kCanRebin);
00840     
00841     hAdcAllStp=new TH1F("hAdcAllStp","hAdcAllStp",
00842                            20320,-320,20000);
00843     hAdcAllStp->SetFillColor(0);
00844     hAdcAllStp->SetTitle("Adc of All Strips in Slice");
00845     hAdcAllStp->GetXaxis()->SetTitle("Adc");
00846     hAdcAllStp->GetXaxis()->CenterTitle();
00847     //hAdcAllStp->SetBit(TH1::kCanRebin);
00848     
00849     
00850     hPeWinStp=new TH1F("hPeWinStp","hPeWinStp",
00851                        10160,-4,250);
00852     hPeWinStp->SetFillColor(0);
00853     hPeWinStp->SetTitle("Pe of Strips in Window (in Slice)");
00854     hPeWinStp->GetXaxis()->SetTitle("Pe");
00855     hPeWinStp->GetXaxis()->CenterTitle();
00856     //hPeWinStp->SetBit(TH1::kCanRebin);
00857     
00858     hPeAllStp=new TH1F("hPeAllStp","hPeAllStp",
00859                        10160,-4,250);
00860     hPeAllStp->SetFillColor(0);
00861     hPeAllStp->SetTitle("Pe of All Strips in Slice");
00862     hPeAllStp->GetXaxis()->SetTitle("Pe");
00863     hPeAllStp->GetXaxis()->CenterTitle();
00864     //hPeAllStp->SetBit(TH1::kCanRebin);
00865     
00866 
00867     hDigitWinStp=new TH1F("hDigitWinStp","hDigitWinStp",
00868                           4020,-2,400);
00869     hDigitWinStp->SetFillColor(0);
00870     hDigitWinStp->SetTitle("Digits of Strips in Window (in Slice)");
00871     hDigitWinStp->GetXaxis()->SetTitle("Digits");
00872     hDigitWinStp->GetXaxis()->CenterTitle();
00873     hDigitWinStp->SetBit(TH1::kCanRebin);
00874     
00875     hDigitAllStp=new TH1F("hDigitAllStp","hDigitAllStp",
00876                           4020,-2,400);
00877     hDigitAllStp->SetFillColor(0);
00878     hDigitAllStp->SetTitle("Digits of All Strips in Slice");
00879     hDigitAllStp->GetXaxis()->SetTitle("Digits");
00880     hDigitAllStp->GetXaxis()->CenterTitle();
00881     //hDigitAllStp->SetBit(TH1::kCanRebin);
00882 
00883 
00884     //stripend 1
00885     hSigMapWinStp1=new TH1F("hSigMapWinStp1","hSigMapWinStp1",
00886                            20320,-320,20000);
00887     hSigMapWinStp1->SetFillColor(0);
00888     hSigMapWinStp1->SetTitle("SigMap of Strips in Window (in Slice)");
00889     hSigMapWinStp1->GetXaxis()->SetTitle("SigMap");
00890     hSigMapWinStp1->GetXaxis()->CenterTitle();
00891     //hSigMapWinStp1->SetBit(TH1::kCanRebin);
00892     
00893     hSigMapAllStp1=new TH1F("hSigMapAllStp1","hSigMapAllStp1",
00894                            20320,-320,20000);
00895     hSigMapAllStp1->SetFillColor(0);
00896     hSigMapAllStp1->SetTitle("SigMap of All Strips in Slice");
00897     hSigMapAllStp1->GetXaxis()->SetTitle("SigMap");
00898     hSigMapAllStp1->GetXaxis()->CenterTitle();
00899     //hSigMapAllStp1->SetBit(TH1::kCanRebin);
00900     
00901 
00902     hSigCorWinStp1=new TH1F("hSigCorWinStp1","hSigCorWinStp1",
00903                            20320,-320,20000);
00904     hSigCorWinStp1->SetFillColor(0);
00905     hSigCorWinStp1->SetTitle("SigCor of Strips in Window (in Slice)");
00906     hSigCorWinStp1->GetXaxis()->SetTitle("SigCor");
00907     hSigCorWinStp1->GetXaxis()->CenterTitle();
00908     //hSigCorWinStp1->SetBit(TH1::kCanRebin);
00909     
00910     hSigCorAllStp1=new TH1F("hSigCorAllStp1","hSigCorAllStp1",
00911                            20320,-320,20000);
00912     hSigCorAllStp1->SetFillColor(0);
00913     hSigCorAllStp1->SetTitle("SigCor of All Strips in Slice");
00914     hSigCorAllStp1->GetXaxis()->SetTitle("SigCor");
00915     hSigCorAllStp1->GetXaxis()->CenterTitle();
00916     //hSigCorAllStp1->SetBit(TH1::kCanRebin);
00917     
00918     
00919     hSigLinWinStp1=new TH1F("hSigLinWinStp1","hSigLinWinStp1",
00920                            20320,-320,20000);
00921     hSigLinWinStp1->SetFillColor(0);
00922     hSigLinWinStp1->SetTitle("SigLin of Strips in Window (in Slice)");
00923     hSigLinWinStp1->GetXaxis()->SetTitle("SigLin");
00924     hSigLinWinStp1->GetXaxis()->CenterTitle();
00925     //hSigLinWinStp1->SetBit(TH1::kCanRebin);
00926     
00927     hSigLinAllStp1=new TH1F("hSigLinAllStp1","hSigLinAllStp1",
00928                            20320,-320,20000);
00929     hSigLinAllStp1->SetFillColor(0);
00930     hSigLinAllStp1->SetTitle("SigLin of All Strips in Slice");
00931     hSigLinAllStp1->GetXaxis()->SetTitle("SigLin");
00932     hSigLinAllStp1->GetXaxis()->CenterTitle();
00933     //hSigLinAllStp1->SetBit(TH1::kCanRebin);
00934     
00935     
00936     hAdcWinStp1=new TH1F("hAdcWinStp1","hAdcWinStp1",
00937                            20320,-320,20000);
00938     hAdcWinStp1->SetFillColor(0);
00939     hAdcWinStp1->SetTitle("Adc of Strips in Window (in Slice)");
00940     hAdcWinStp1->GetXaxis()->SetTitle("Adc");
00941     hAdcWinStp1->GetXaxis()->CenterTitle();
00942     //hAdcWinStp1->SetBit(TH1::kCanRebin);
00943     
00944     hAdcAllStp1=new TH1F("hAdcAllStp1","hAdcAllStp1",
00945                            20320,-320,20000);
00946     hAdcAllStp1->SetFillColor(0);
00947     hAdcAllStp1->SetTitle("Adc of All Strips in Slice");
00948     hAdcAllStp1->GetXaxis()->SetTitle("Adc");
00949     hAdcAllStp1->GetXaxis()->CenterTitle();
00950     //hAdcAllStp1->SetBit(TH1::kCanRebin);
00951     
00952     
00953     hPeWinStp1=new TH1F("hPeWinStp1","hPeWinStp1",
00954                        10160,-4,250);
00955     hPeWinStp1->SetFillColor(0);
00956     hPeWinStp1->SetTitle("Pe of Strips in Window (in Slice)");
00957     hPeWinStp1->GetXaxis()->SetTitle("Pe");
00958     hPeWinStp1->GetXaxis()->CenterTitle();
00959     //hPeWinStp1->SetBit(TH1::kCanRebin);
00960     
00961     hPeAllStp1=new TH1F("hPeAllStp1","hPeAllStp1",
00962                        10160,-4,250);
00963     hPeAllStp1->SetFillColor(0);
00964     hPeAllStp1->SetTitle("Pe of All Strips in Slice");
00965     hPeAllStp1->GetXaxis()->SetTitle("Pe");
00966     hPeAllStp1->GetXaxis()->CenterTitle();
00967     //hPeAllStp1->SetBit(TH1::kCanRebin);
00968     
00969 
00970     hDigitWinStp1=new TH1F("hDigitWinStp1","hDigitWinStp1",
00971                           4020,-2,400);
00972     hDigitWinStp1->SetFillColor(0);
00973     hDigitWinStp1->SetTitle("Digits of Strips in Window (in Slice)");
00974     hDigitWinStp1->GetXaxis()->SetTitle("Digits");
00975     hDigitWinStp1->GetXaxis()->CenterTitle();
00976     //hDigitWinStp1->SetBit(TH1::kCanRebin);
00977     
00978     hDigitAllStp1=new TH1F("hDigitAllStp1","hDigitAllStp1",
00979                           4020,-2,400);
00980     hDigitAllStp1->SetFillColor(0);
00981     hDigitAllStp1->SetTitle("Digits of All Strips in Slice");
00982     hDigitAllStp1->GetXaxis()->SetTitle("Digits");
00983     hDigitAllStp1->GetXaxis()->CenterTitle();
00984     //hDigitAllStp1->SetBit(TH1::kCanRebin);
00985 
00986 
00987     //stripend 2
00988     hSigMapWinStp2=new TH1F("hSigMapWinStp2","hSigMapWinStp2",
00989                            20320,-320,20000);
00990     hSigMapWinStp2->SetFillColor(0);
00991     hSigMapWinStp2->SetTitle("SigMap of Strips in Window (in Slice)");
00992     hSigMapWinStp2->GetXaxis()->SetTitle("SigMap");
00993     hSigMapWinStp2->GetXaxis()->CenterTitle();
00994     //hSigMapWinStp2->SetBit(TH1::kCanRebin);
00995     
00996     hSigMapAllStp2=new TH1F("hSigMapAllStp2","hSigMapAllStp2",
00997                            20320,-320,20000);
00998     hSigMapAllStp2->SetFillColor(0);
00999     hSigMapAllStp2->SetTitle("SigMap of All Strips in Slice");
01000     hSigMapAllStp2->GetXaxis()->SetTitle("SigMap");
01001     hSigMapAllStp2->GetXaxis()->CenterTitle();
01002     //hSigMapAllStp2->SetBit(TH1::kCanRebin);
01003     
01004 
01005     hSigCorWinStp2=new TH1F("hSigCorWinStp2","hSigCorWinStp2",
01006                            20320,-320,20000);
01007     hSigCorWinStp2->SetFillColor(0);
01008     hSigCorWinStp2->SetTitle("SigCor of Strips in Window (in Slice)");
01009     hSigCorWinStp2->GetXaxis()->SetTitle("SigCor");
01010     hSigCorWinStp2->GetXaxis()->CenterTitle();
01011     //hSigCorWinStp2->SetBit(TH1::kCanRebin);
01012     
01013     hSigCorAllStp2=new TH1F("hSigCorAllStp2","hSigCorAllStp2",
01014                            20320,-320,20000);
01015     hSigCorAllStp2->SetFillColor(0);
01016     hSigCorAllStp2->SetTitle("SigCor of All Strips in Slice");
01017     hSigCorAllStp2->GetXaxis()->SetTitle("SigCor");
01018     hSigCorAllStp2->GetXaxis()->CenterTitle();
01019     //hSigCorAllStp2->SetBit(TH1::kCanRebin);
01020     
01021     
01022     hSigLinWinStp2=new TH1F("hSigLinWinStp2","hSigLinWinStp2",
01023                            20320,-320,20000);
01024     hSigLinWinStp2->SetFillColor(0);
01025     hSigLinWinStp2->SetTitle("SigLin of Strips in Window (in Slice)");
01026     hSigLinWinStp2->GetXaxis()->SetTitle("SigLin");
01027     hSigLinWinStp2->GetXaxis()->CenterTitle();
01028     //hSigLinWinStp2->SetBit(TH1::kCanRebin);
01029     
01030     hSigLinAllStp2=new TH1F("hSigLinAllStp2","hSigLinAllStp2",
01031                            20320,-320,20000);
01032     hSigLinAllStp2->SetFillColor(0);
01033     hSigLinAllStp2->SetTitle("SigLin of All Strips in Slice");
01034     hSigLinAllStp2->GetXaxis()->SetTitle("SigLin");
01035     hSigLinAllStp2->GetXaxis()->CenterTitle();
01036     //hSigLinAllStp2->SetBit(TH1::kCanRebin);
01037     
01038     
01039     hAdcWinStp2=new TH1F("hAdcWinStp2","hAdcWinStp2",
01040                            20320,-320,20000);
01041     hAdcWinStp2->SetFillColor(0);
01042     hAdcWinStp2->SetTitle("Adc of Strips in Window (in Slice)");
01043     hAdcWinStp2->GetXaxis()->SetTitle("Adc");
01044     hAdcWinStp2->GetXaxis()->CenterTitle();
01045     //hAdcWinStp2->SetBit(TH1::kCanRebin);
01046     
01047     hAdcAllStp2=new TH1F("hAdcAllStp2","hAdcAllStp2",
01048                            20320,-320,20000);
01049     hAdcAllStp2->SetFillColor(0);
01050     hAdcAllStp2->SetTitle("Adc of All Strips in Slice");
01051     hAdcAllStp2->GetXaxis()->SetTitle("Adc");
01052     hAdcAllStp2->GetXaxis()->CenterTitle();
01053     //hAdcAllStp2->SetBit(TH1::kCanRebin);
01054     
01055     
01056     hPeWinStp2=new TH1F("hPeWinStp2","hPeWinStp2",
01057                        10160,-4,250);
01058     hPeWinStp2->SetFillColor(0);
01059     hPeWinStp2->SetTitle("Pe of Strips in Window (in Slice)");
01060     hPeWinStp2->GetXaxis()->SetTitle("Pe");
01061     hPeWinStp2->GetXaxis()->CenterTitle();
01062     //hPeWinStp2->SetBit(TH1::kCanRebin);
01063     
01064     hPeAllStp2=new TH1F("hPeAllStp2","hPeAllStp2",
01065                        10160,-4,250);
01066     hPeAllStp2->SetFillColor(0);
01067     hPeAllStp2->SetTitle("Pe of All Strips in Slice");
01068     hPeAllStp2->GetXaxis()->SetTitle("Pe");
01069     hPeAllStp2->GetXaxis()->CenterTitle();
01070     //hPeAllStp2->SetBit(TH1::kCanRebin);
01071     
01072 
01073     hDigitWinStp2=new TH1F("hDigitWinStp2","hDigitWinStp2",
01074                           4020,-2,400);
01075     hDigitWinStp2->SetFillColor(0);
01076     hDigitWinStp2->SetTitle("Digits of Strips in Window (in Slice)");
01077     hDigitWinStp2->GetXaxis()->SetTitle("Digits");
01078     hDigitWinStp2->GetXaxis()->CenterTitle();
01079     //hDigitWinStp2->SetBit(TH1::kCanRebin);
01080     
01081     hDigitAllStp2=new TH1F("hDigitAllStp2","hDigitAllStp2",
01082                           4020,-2,400);
01083     hDigitAllStp2->SetFillColor(0);
01084     hDigitAllStp2->SetTitle("Digits of All Strips in Slice");
01085     hDigitAllStp2->GetXaxis()->SetTitle("Digits");
01086     hDigitAllStp2->GetXaxis()->CenterTitle();
01087     //hDigitAllStp2->SetBit(TH1::kCanRebin);
01088   }
01089   
01090   TClonesArray& stpTca=(*ntp.stp);
01091   Int_t numStps=stpTca.GetEntries();
01092 
01093   Double_t earliestTime=999;
01094   Double_t latestTime=-999;
01095   multiset<Double_t> times;
01096 
01097   //this loop is over ALL the strips in the whole SNARL
01098   for (Int_t i=0;i<numStps;i++){
01099     
01100     const NtpSRStrip* pstp=dynamic_cast<NtpSRStrip*>(stpTca[i]);
01101     const NtpSRStrip& stp=(*pstp);
01102 
01103     //Int_t pl=stp.plane;
01104 
01105     //get earliest and latest times in snarl
01106     if (stp.time1>=0 && stp.time1>latestTime) latestTime=stp.time1;
01107     if (stp.time0>=0 && stp.time0>latestTime) latestTime=stp.time0;
01108     if (stp.time1>=0 && stp.time1<earliestTime) earliestTime=stp.time1;
01109     if (stp.time0>=0 && stp.time0<earliestTime) earliestTime=stp.time0;
01110 
01111     Double_t time=stp.time0;
01112     if (time<0 || time>1) time=stp.time1;
01113     
01114     if (time>0 && time<=1) {
01115       times.insert(time);
01116     }
01117     
01118     MAXMSG("MeuCuts",Msg::kDebug,500)
01119       <<"t0="<<stp.time0<<", t1="<<stp.time1
01120       <<", lT="<<latestTime<<", eT="<<earliestTime
01121       <<", dT="<<(latestTime-earliestTime)/Munits::ns<<endl;
01122   }
01123 
01124   //get the median time from the map
01125   multiset<Double_t>::const_iterator it=times.begin();
01126   advance(it,times.size()/2);
01127   Double_t medianTime=*it;
01128   MAXMSG("MeuCuts",Msg::kDebug,200)
01129     <<"Median time="<<medianTime
01130     <<", dBefore="<<(medianTime-earliestTime)/Munits::ns
01131     <<", dAfter="<<(latestTime-medianTime)/Munits::ns<<endl;
01132   
01133   //these get filled for each selected event in the snarl
01134   //so there is potentially double counting if more than one good 
01135   //stopping muon per snarl
01136   hTimeAfter->Fill((latestTime-medianTime)/Munits::ns);
01137   hTimeBefore->Fill((medianTime-earliestTime)/Munits::ns);
01138   hTimeLength->Fill((latestTime-earliestTime)/Munits::ns);
01139 
01141   //now look at slice times
01143 
01144   //reset variables
01145   earliestTime=999;
01146   latestTime=-999;
01147   times.clear();
01148   
01149   TClonesArray& slcTca=(*ntp.slc);
01150   
01151   //get the slice associated with this event
01152   const NtpSRSlice* pslc=
01153     dynamic_cast<NtpSRSlice*>(slcTca[evt.slc]);
01154   const NtpSRSlice& slc=(*pslc);
01155   
01156   //loop over the strips in the slc that the event was found in
01157   for (Int_t i=0;i<slc.nstrip;++i) {
01158     const NtpSRStrip* pstp=
01159       dynamic_cast<NtpSRStrip*>(stpTca[slc.stp[i]]);
01160     const NtpSRStrip& stp=(*pstp);
01161 
01162     //get earliest and latest times in snarl
01163     if (stp.time1>=0 && stp.time1>latestTime) latestTime=stp.time1;
01164     if (stp.time0>=0 && stp.time0>latestTime) latestTime=stp.time0;
01165     if (stp.time1>=0 && stp.time1<earliestTime) earliestTime=stp.time1;
01166     if (stp.time0>=0 && stp.time0<earliestTime) earliestTime=stp.time0;
01167     
01168     Double_t time=stp.time0;
01169     if (time<0 || time>1) time=stp.time1;
01170     
01171     if (time>0 && time<=1) {
01172       times.insert(time);
01173     }
01174     
01175     //make a plot of how the energy deposition changes with time cut
01176     //I don't think this actually works...
01177     if ((stp.plane>=s.WinVtxSidePl && stp.plane<=s.WinStopSidePl) ||
01178         (stp.plane<=s.WinVtxSidePl && stp.plane>=s.WinStopSidePl)) {
01179 
01180       Double_t timeDiff=time-s.MedianTime;
01181       MAXMSG("MeuCuts",Msg::kDebug,50)
01182         <<"timeDiff="<<timeDiff/(Munits::ns)<<", time="<<time
01183         <<", Median="<<s.MedianTime<<endl;
01184       for (Int_t n=1;n<11;n++) {
01185         if (timeDiff<n*100.*(Munits::ns)) {
01186           MAXMSG("MeuCuts",Msg::kDebug,300)
01187             <<"n="<<n<<", filling..."<<endl;
01188           pAdcVsTimeCut->Fill(n*100,stp.ph1.raw);
01189           pSigCorVsTimeCut->Fill(n*100,stp.ph1.sigcor);
01190         }
01191         else if (timeDiff>10*100.*(Munits::ns) && n==10){
01192           MAXMSG("MeuCuts",Msg::kDebug,300)
01193             <<"n="<<n<<", filling last bin"<<endl;
01194           pAdcVsTimeCut->Fill(10*100,stp.ph1.raw);
01195           pSigCorVsTimeCut->Fill(10*100,stp.ph1.sigcor);
01196         }
01197         else {
01198           MAXMSG("MeuCuts",Msg::kDebug,300)
01199             <<"n="<<n<<", not filling bin"<<endl;
01200         }
01201       }
01202     }
01203     
01205     //section to make plots of all hit strip distributions
01206     //hSigMapWinStp->Fill();//no sigmap data
01207     hSigCorAllStp->Fill(stp.ph0.sigcor+stp.ph1.sigcor);
01208     hSigLinAllStp->Fill(stp.ph0.siglin+stp.ph1.siglin);
01209     hAdcAllStp->Fill(stp.ph0.raw+stp.ph1.raw);
01210     hPeAllStp->Fill(stp.ph0.pe+stp.ph1.pe);
01211     hDigitAllStp->Fill(stp.ndigit);
01212 
01213     //hSigMapAllStp1->Fill();//no sigmap data
01214     hSigCorAllStp1->Fill(stp.ph0.sigcor);
01215     hSigLinAllStp1->Fill(stp.ph0.siglin);
01216     hAdcAllStp1->Fill(stp.ph0.raw);
01217     hPeAllStp1->Fill(stp.ph0.pe);
01218     //hDigitAllStp1->Fill(stp.ndigit);//no data for individual stripend 
01219 
01220     //hSigMapAllStp2->Fill();//no sigmap data
01221     hSigCorAllStp2->Fill(stp.ph1.sigcor);
01222     hSigLinAllStp2->Fill(stp.ph1.siglin);
01223     hAdcAllStp2->Fill(stp.ph1.raw);
01224     hPeAllStp2->Fill(stp.ph1.pe);
01225     //hDigitAllStp2->Fill(stp.ndigit);//no data for individual stripend 
01226 
01227     
01228     //check if plane is in window
01229     if ((stp.plane>=s.WinVtxSidePl && stp.plane<=s.WinStopSidePl) ||
01230         (stp.plane<=s.WinVtxSidePl && stp.plane>=s.WinStopSidePl)) {
01231       //hSigMapWinStp->Fill();//no sigmap data
01232       hSigCorWinStp->Fill(stp.ph0.sigcor+stp.ph1.sigcor);
01233       hSigLinWinStp->Fill(stp.ph0.siglin+stp.ph1.siglin);
01234       hAdcWinStp->Fill(stp.ph0.raw+stp.ph1.raw);
01235       hPeWinStp->Fill(stp.ph0.pe+stp.ph1.pe);
01236       hDigitWinStp->Fill(stp.ndigit);
01237       
01238       //hSigMapWinStp1->Fill();//no sigmap data
01239       hSigCorWinStp1->Fill(stp.ph0.sigcor);
01240       hSigLinWinStp1->Fill(stp.ph0.siglin);
01241       hAdcWinStp1->Fill(stp.ph0.raw);
01242       hPeWinStp1->Fill(stp.ph0.pe);
01243       //hDigitWinStp1->Fill(stp.ndigit);//no data 4 individual stripend 
01244       
01245       //hSigMapWinStp2->Fill();//no sigmap data
01246       hSigCorWinStp2->Fill(stp.ph1.sigcor);
01247       hSigLinWinStp2->Fill(stp.ph1.siglin);
01248       hAdcWinStp2->Fill(stp.ph1.raw);
01249       hPeWinStp2->Fill(stp.ph1.pe);
01250       //hDigitWinStp2->Fill(stp.ndigit);//no data 4 individual stripend 
01251     }
01252   }
01253 
01254   //get the median time from the map
01255   it=times.begin();
01256   advance(it,times.size()/2);
01257   medianTime=*it;
01258   
01259   hSlcTimeAfter->Fill((latestTime-medianTime)/Munits::ns);
01260   hSlcTimeBefore->Fill((medianTime-earliestTime)/Munits::ns);
01261   hSlcTimeLength->Fill((latestTime-earliestTime)/Munits::ns);
01262   
01264   //now look at track times
01266 
01267   //reset variables
01268   earliestTime=999;
01269   latestTime=-999;
01270   times.clear();
01271   
01272   TClonesArray& trkTca=(*ntp.trk);
01273   Int_t numTrks=evt.ntrack;
01274   
01275   //loop over the tracks in the event
01276   for (Int_t itrk=0;itrk<numTrks;itrk++){
01277     const NtpSRTrack* ptrk=
01278       dynamic_cast<NtpSRTrack*>(trkTca[evt.trk[itrk]]);
01279     const NtpSRTrack& trk=(*ptrk);
01280     
01281     TClonesArray& stpTca=(*ntp.stp);
01282       
01283     //this loop is just over the tracked strips
01284     for (Int_t i=0;i<trk.nstrip;i++){
01285 
01286       //check for bug where strip index is -1
01287       if (trk.stp[i]<0) {
01288         MAXMSG("MeuCuts",Msg::kInfo,50)
01289           <<"Skipping strip with trk.stp[i]="<<trk.stp[i]<<endl;
01290         continue;
01291       }
01292       const NtpSRStrip* pstp=
01293         dynamic_cast<NtpSRStrip*>(stpTca[trk.stp[i]]);
01294       const NtpSRStrip& stp=(*pstp);  
01295   
01296       //get earliest and latest times in snarl
01297       if (stp.time1>=0 && stp.time1>latestTime) latestTime=stp.time1;
01298       if (stp.time0>=0 && stp.time0>latestTime) latestTime=stp.time0;
01299       if (stp.time1>=0 && stp.time1<earliestTime) earliestTime=
01300                                                     stp.time1;
01301       if (stp.time0>=0 && stp.time0<earliestTime) earliestTime=
01302                                                     stp.time0;
01303       
01304       Double_t time=stp.time0;
01305       if (time<0 || time>1) time=stp.time1;
01306       
01307       if (time>0 && time<=1) {
01308         times.insert(time);
01309       }
01310     }
01311   }
01312     
01313   //get the median time from the map
01314   it=times.begin();
01315   advance(it,times.size()/2);
01316   Double_t medianTimeTrk=*it;
01317 
01318   MAXMSG("MeuCuts",Msg::kDebug,500)
01319     <<"Median time for slc and trk difference="
01320     <<(medianTime-medianTimeTrk)/Munits::ns<<endl;
01321 
01322   hMedianTrkSlcDiff->Fill((medianTime-medianTimeTrk)/Munits::ns);
01323   
01324   hTrkTimeAfter->Fill((latestTime-medianTimeTrk)/Munits::ns);
01325   hTrkTimeBefore->Fill((medianTimeTrk-earliestTime)/Munits::ns);
01326   hTrkTimeLength->Fill((latestTime-earliestTime)/Munits::ns);
01327 }

Bool_t MeuCuts::FilterBadDistEndStrip ( const MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo,
Float_t *  minDistEndStrip = 0 
) const

Definition at line 412 of file MeuCuts.cxx.

References Msg::kDebug, Msg::kWarning, MAXMSG, and Munits::s.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::N_1Plots(), and MeuAnalysis::SpillPlots().

00414 {
00415   Bool_t filter=false;
00416 
00417   //only run for ND at present
00418   //if (s.Detector!=Detector::kNear) return filter;
00419 
00420   Float_t minDist=999;
00421   Int_t lowPl=s.WinVtxSidePl;
00422   Int_t highPl=s.WinStopSidePl;
00423   if (lowPl>highPl){
00424     lowPl=s.WinStopSidePl;
00425     highPl=s.WinVtxSidePl;
00426   }
00427   
00428   //check that planes exist
00429   if (plInfo.find(lowPl)==plInfo.end() ||
00430       plInfo.find(highPl)==plInfo.end()) {
00431     MAXMSG("MeuCuts",Msg::kWarning,200)
00432       <<"FilterBadDistEndStrip: no window, can't do it!"<<endl;
00433     filter=true;
00434     return filter;
00435   }
00436   
00437   //loop over planes in window
00438   for (map<Int_t,MeuHitInfo>::const_iterator it=plInfo.find(lowPl);
00439        it!=++plInfo.find(highPl);++it){//stop at 1 past highPl
00440     
00441     const MeuHitInfo& cp=it->second;
00442 
00443     Float_t distToStripEnd=cp.StripHalfLength-
00444       fabs(cp.DistToStripCentre);
00445     if (distToStripEnd<minDist) minDist=distToStripEnd;
00446     
00447     if (distToStripEnd<0.2){
00448       filter=true;
00449     }
00450 
00451     MAXMSG("MeuCuts",Msg::kDebug,500)
00452       <<"pl="<<cp.Plane<<", distToStripEnd="<<distToStripEnd
00453       <<", HL="<<cp.StripHalfLength
00454       <<", distToCent="<<cp.DistToStripCentre
00455       <<", filt="<<filter<<endl;
00456   }
00457 
00458   //write out minDist if requested
00459   if (minDistEndStrip) *minDistEndStrip=minDist;
00460   
00461   return filter;
00462 }

Bool_t MeuCuts::FilterBadEndGaps ( const MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo,
Float_t *  adcInGap = 0 
) const

Definition at line 341 of file MeuCuts.cxx.

References MeuHitInfo::Adc, Msg::kDebug, Msg::kFatal, MAXMSG, MSG, Munits::s, and MeuHitInfo::Strip.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::N_1Plots(), and MeuAnalysis::SpillPlots().

00343 {
00344   Bool_t posDir=(s.EndPlane>s.VtxPlane);
00345   Bool_t badGap=false;
00346   Float_t sumAdcInGap=0;
00347 
00348   //static TH1F* hSumTrkEndGapAdc=0;
00349   //if (hSumTrkEndGapAdc==0) {
00350   //  hSumTrkEndGapAdc=new TH1F("hSumTrkEndGapAdc",
00351   //                  "hSumTrkEndGapAdc",1000,-1,5000);
00352   //}
00353 
00354   //look in the last 7 planes
00355   Int_t startPl=s.EndPlane-6;
00356   if (!posDir) startPl=s.EndPlane+6;
00357 
00358   MAXMSG("MeuCuts",Msg::kDebug,10)
00359     <<"FilterBadEndGaps: startPlane="<<startPl
00360     <<", track:"<<s.VtxPlane<<"->"<<s.EndPlane<<endl;
00361   
00362   Int_t pl=startPl;
00363   while (pl!=s.EndPlane){
00364 
00365     MAXMSG("MeuCuts",Msg::kDebug,200)
00366       <<"Looping: pl="<<pl<<endl;
00367 
00368     map<Int_t,MeuHitInfo>::const_iterator it=plInfo.find(pl);
00369     if (it==plInfo.end()) {
00370       MSG("MeuCuts",Msg::kFatal)
00371         <<"Ahhh = .end(), pl="<<pl<<", startPlane="<<startPl
00372         <<", track:"<<s.VtxPlane<<"->"<<s.EndPlane<<endl
00373         <<endl<<"Will exit here..."<<endl;
00374       exit(1);
00375     }
00376 
00377     const MeuHitInfo& cp=it->second;
00378 
00379     //check if there was a tracked strip in this plane
00380     if (cp.Strip>=0) {
00381       if (posDir) pl++;
00382       else pl--;
00383       continue;
00384     }
00385 
00386     MAXMSG("MeuCuts",Msg::kDebug,100)
00387       <<"Found untracked plane="<<pl
00388       <<", adc="<<cp.Adc<<", sumAdc="<<sumAdcInGap<<endl;
00389 
00390     sumAdcInGap+=cp.Adc;
00391 
00392     if (posDir) pl++;
00393     else pl--;
00394   }
00395 
00396   if (sumAdcInGap>500) {
00397     MAXMSG("MeuCuts",Msg::kDebug,100)
00398       <<"Found bad track end gap, run="<<s.Run<<", snarl="<<s.Snarl
00399       <<", sumAdc="<<sumAdcInGap<<endl;
00400     badGap=true;
00401   }
00402 
00403   //output value
00404   if (adcInGap) *adcInGap=sumAdcInGap;
00405 
00406   return badGap;
00407 }

Bool_t MeuCuts::FilterBadEvtPerSlc ( const NtpStRecord ntp,
Int_t  slc,
Int_t  entry,
Int_t *  evts = 0 
) const

Definition at line 234 of file MeuCuts.cxx.

References NtpStRecord::evt, Msg::kDebug, MAXMSG, print(), and NtpSREvent::slc.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::SpillPlots(), and MeuAnalysis::TestEventLoop().

00236 {
00237   static Int_t lastEntry=-1;
00238   static map<Int_t,Int_t> evtPerSlc;
00239 
00240   //build the map if new entry
00241   if (entry!=lastEntry){
00242     MAXMSG("MeuCuts",Msg::kDebug,30)
00243       <<"Building map..."<<endl;
00244 
00245     evtPerSlc.clear();
00246     
00247     //cache the entry the map was built with
00248     lastEntry=entry;
00249     
00250     TClonesArray& evtTca=(*ntp.evt);
00251     const Int_t numEvts=evtTca.GetEntriesFast();
00252     
00253     //loop over the events
00254     for (Int_t ntpevt=0;ntpevt<numEvts;++ntpevt) {
00255       const NtpSREvent* pevt=
00256         dynamic_cast<NtpSREvent*>(evtTca[ntpevt]);
00257       const NtpSREvent& evt=(*pevt);
00258 
00259       //count up the number of events per slice
00260       evtPerSlc[evt.slc]++;      
00261     }
00262 
00263     Bool_t print=false;
00264     if (print){
00265       //make this into a function
00266       //Bool_t FilterMultiEvtPerSlc(ntp,slc,entry)
00267       typedef map<Int_t,Int_t>::const_iterator slcIt;
00268       MAXMSG("MeuCuts",Msg::kDebug,30)
00269         <<"Events per slice for entry="<<entry<<endl;
00270       for (slcIt it=evtPerSlc.begin();it!=evtPerSlc.end();++it) {
00271         MAXMSG("MeuCuts",Msg::kDebug,200)
00272           <<"  slice "<<it->first<<" has "
00273           <<it->second<<" event(s)"<<endl;
00274       }
00275     }
00276   }
00277   
00278   if (evts!=0) {
00279     if (evtPerSlc.find(slc)!=evtPerSlc.end()) {
00280       *evts=evtPerSlc[slc];
00281     }
00282     else *evts=-1;
00283   }
00284   
00285   return evtPerSlc[slc]!=1;//true if evts != exactly 1 in this slc
00286 }

Bool_t MeuCuts::FilterBadShwDist ( const NtpStRecord ntp,
MeuSummary s,
const NtpSREvent evt,
Int_t *  shwDist = 0 
) const

Definition at line 1404 of file MeuCuts.cxx.

References Msg::kInfo, Detector::kNear, MAXMSG, NtpSREvent::nshower, Munits::s, NtpSREvent::shw, and NtpStRecord::shw.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl().

01407 {
01408   //only run this for the ND at present
01409   if (s.Detector!=Detector::kNear) {
01410     MAXMSG("MeuCuts",Msg::kInfo,1)
01411       <<"Not running FilterBadShwDist for detector="<<s.Detector
01412       <<", it is only implemented for ND spill data"<<endl;
01413     return false;
01414   }
01415   
01416   //this algorithm assumes forward going showers so
01417   //only run filter for spills (don't worry about shws for cosmics)
01418   if (s.TrigSrc<100) {
01419     MAXMSG("MeuCuts",Msg::kInfo,1)
01420       <<"Not doing FilterBadShwDist, trigSrc="<<s.TrigSrc
01421       <<", simFlag="<<s.SimFlag<<endl;
01422     return false;
01423   }
01424   
01425   Bool_t badShwDist=false;
01426   
01427   Int_t shwVtxPl=999;
01428   Int_t shwEndPl=-999;
01429             
01430   //loop over showers in evt
01431   TClonesArray& shwTca=(*ntp.shw);
01432   for(int i=0;i<evt.nshower;i++) {    
01433     const NtpSRShower* pshw=
01434       dynamic_cast<NtpSRShower*>(shwTca[evt.shw[i]]);
01435     const NtpSRShower& shw=(*pshw);
01436               
01437     //define a vtx shower to be one that starts within 5 pl
01438     Bool_t vtxShw=abs(s.VtxPlane-shw.plane.beg)<=5;
01439               
01440     if (vtxShw){
01441       if (shw.plane.beg<shwVtxPl) shwVtxPl=shw.plane.beg;
01442       if (shw.plane.end>shwEndPl) shwEndPl=shw.plane.end;
01443     }
01444   }
01445   
01446   Bool_t vtxShw=false;
01447   if (shwEndPl!=-999 && shwVtxPl!=999) vtxShw=true;
01448 
01449   Int_t winPlFromShwEnd=999;
01450   
01451   //if a vtx shower was found then can check if it was close to window
01452   if (vtxShw){
01453     winPlFromShwEnd=s.WinVtxSidePl-shwEndPl;
01454     //require that shw stops 10 planes before window starts
01455     if (winPlFromShwEnd<10) badShwDist=true;
01456   }
01457 
01458   //write out shw dist if requested
01459   if (shwDist) *shwDist=winPlFromShwEnd;
01460   
01461   return badShwDist;
01462 }

Bool_t MeuCuts::FilterBadTrackEnd ( const MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo,
Float_t *  sigBeyondEnd = 0 
) const

Definition at line 291 of file MeuCuts.cxx.

References Msg::kVerbose, MAXMSG, and Munits::s.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu(), MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), MeuAnalysis::N_1Plots(), and MeuAnalysis::SpillPlots().

00293 {
00294   Bool_t posDir=(s.EndPlane>s.VtxPlane);
00295   Bool_t badTracking=false;
00296 
00297   Float_t sumSigCorBeyondEnd=0;
00298   Float_t sumAdcBeyondEnd=0;
00299 
00300   typedef map<Int_t,MeuHitInfo>::const_iterator iter;
00301   for (iter it=plInfo.begin();it!=plInfo.end();++it){
00302     const MeuHitInfo& cp=it->second;
00303     Int_t pl=cp.Plane;
00304     
00305     //work out if the plane is outside the track range on the stop
00306     //end side
00307     Bool_t beyondTrkEnd=pl<s.EndPlane;
00308     if (posDir) beyondTrkEnd=pl>s.EndPlane;
00309 
00310     MAXMSG("MeuCuts",Msg::kVerbose,1000)
00311       <<"pl="<<pl<<", track:"<<s.VtxPlane<<"->"<<s.EndPlane<<endl;
00312 
00313     if (!beyondTrkEnd) continue;
00314 
00315     sumSigCorBeyondEnd+=cp.SigCor;
00316     sumAdcBeyondEnd+=cp.Adc;
00317 
00318     MAXMSG("MeuCuts",Msg::kVerbose,1000)
00319       <<"Charge beyond trk end: pl="<<pl
00320       <<", track: "<<s.VtxPlane<<"->"<<s.EndPlane
00321       <<", sum="<<sumSigCorBeyondEnd<<endl; 
00322 
00323     //if there is more than 15 pe beyond the end of a stopping muon
00324     //track it is almost certainly misreconstructed.
00325     //this is dangerous for containment and it also affect the position
00326     //of the track window
00327     //15 pe = 15*70 = 1050
00328     //but changed to be 500, since the distribution falls off strongly
00329     if (sumSigCorBeyondEnd>500 || sumAdcBeyondEnd>500) badTracking=true;
00330   }
00331   
00332   //write out signal quantity if requested
00333   if (sigBeyondEnd!=0) *sigBeyondEnd=sumAdcBeyondEnd;
00334 
00335   return badTracking;
00336 }

Bool_t MeuCuts::FilterBadTrkTimes ( const NtpStRecord ntp,
MeuSummary s,
const NtpSREvent evt 
) const

Definition at line 1331 of file MeuCuts.cxx.

References Msg::kInfo, MAXMSG, NtpSREvent::ntrack, NtpStRecord::stp, NtpSREvent::trk, and NtpStRecord::trk.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

01333 {
01334   Bool_t badTrkTimes=false;
01335 
01336   //reset variables
01337   Double_t earliestTime=999;
01338   Double_t latestTime=-999;
01339   multiset<Double_t> times;
01340   
01341   TClonesArray& trkTca=(*ntp.trk);
01342   Int_t numTrks=evt.ntrack;
01343   
01344   for (Int_t itrk=0;itrk<numTrks;itrk++){
01345     const NtpSRTrack* ptrk=
01346       dynamic_cast<NtpSRTrack*>(trkTca[evt.trk[itrk]]);
01347     const NtpSRTrack& trk=(*ptrk);
01348     
01349     TClonesArray& stpTca=(*ntp.stp);
01350       
01351     //this loop is just over the tracked strips
01352     for (Int_t i=0;i<trk.nstrip;i++){
01353 
01354       //check for bug where strip index is -1
01355       if (trk.stp[i]<0) {
01356         MAXMSG("MeuCuts",Msg::kInfo,50)
01357           <<"Skipping strip with trk.stp[i]="<<trk.stp[i]<<endl;
01358         continue;
01359       }
01360 
01361       const NtpSRStrip* pstp=
01362         dynamic_cast<NtpSRStrip*>(stpTca[trk.stp[i]]);
01363       const NtpSRStrip& stp=(*pstp);  
01364   
01365       //get earliest and latest times in snarl
01366       if (stp.time1>=0 && stp.time1>latestTime) latestTime=stp.time1;
01367       if (stp.time0>=0 && stp.time0>latestTime) latestTime=stp.time0;
01368       if (stp.time1>=0 && stp.time1<earliestTime) earliestTime=
01369                                                     stp.time1;
01370       if (stp.time0>=0 && stp.time0<earliestTime) earliestTime=
01371                                                     stp.time0;
01372       
01373       Double_t time=stp.time0;
01374       if (time<0 || time>1) time=stp.time1;
01375       
01376       if (time>0 && time<=1) {
01377         times.insert(time);
01378       }
01379     }
01380   }
01381   
01382   //get the median time from the map
01383   multiset<Double_t>::const_iterator it=times.begin();
01384   advance(it,times.size()/2);
01385   const Double_t medianTimeTrk=*it;
01386 
01387   if (latestTime>medianTimeTrk+(400*Munits::ns) ||
01388       earliestTime<medianTimeTrk-(400*Munits::ns)) {
01389     MAXMSG("MeuCuts",Msg::kDebug,200)
01390       <<"Median time="<<medianTimeTrk
01391       <<", dBefore="<<(medianTimeTrk-earliestTime)/Munits::ns
01392       <<", dAfter="<<(latestTime-medianTimeTrk)/Munits::ns<<endl;
01393     badTrkTimes=true;
01394   }
01395 
01396   //set the median time in the summary
01397   s.MedianTime=medianTimeTrk;
01398   
01399   return badTrkTimes;
01400 }

Bool_t MeuCuts::FilterBadXY ( const AtmosEvent ev,
const MeuSummary s 
) const

Definition at line 180 of file MeuCuts.cxx.

References Msg::kDebug, Msg::kWarning, MSG, Munits::s, AtmosEvent::StripList, AtmosEvent::TrackList, and AtmosStrip::Trk.

Referenced by MeuAnalysis::MakeSummaryTreeWithAtNu().

00182 {
00183   const AtmosTrack* track=dynamic_cast<const AtmosTrack*>
00184     (ev.TrackList->At(0));
00185   //cut out events with no track
00186   if (!track) {
00187     //fAwayFromCoil=false;//set to false by default
00188     return true;
00189   }
00190  
00191   TClonesArray& strips=(*ev.StripList);
00192   Int_t numStrips=strips.GetEntries();
00193   if (numStrips<=0) {
00194     MSG("MeuCuts",Msg::kWarning)
00195       <<"numStrips="<<numStrips<<endl;
00196     //fAwayFromCoil=false;//set to false by default
00197     return true;
00198   }
00199 
00200   if (s.VtxPlane<0 || s.EndPlane<0){
00201     MSG("MeuCuts",Msg::kWarning)
00202       <<"No vtx and/or end plane for this event!"<<endl;
00203     //fAwayFromCoil=false;//set to false by default
00204     return true;
00205   } 
00206 
00208   //loop over the strips in the snarl
00210   for (Int_t hit=0;hit<numStrips;hit++){
00211     const AtmosStrip* strip=dynamic_cast<AtmosStrip*>(strips[hit]);
00212     const AtmosStrip& st=(*strip);
00213     
00214     //cut out the non-tracked strips
00215     if (!st.Trk) continue;
00216     
00217     //calc the x,y,z positions
00218     Float_t x=-99999;
00219     Float_t y=-99999;
00220     Float_t z=-99999;
00221     this->CalcXYZ(ev,st,x,y,z);
00222     if (fabs(x)>4.1 || fabs(y)>4.1) {
00223       MSG("MeuCuts",Msg::kDebug)
00224         <<"silly x or y; x="<<x<<", y="<<y<<endl;
00225       return true;//true=filter this one
00226     }    
00227   }//end of loop over strips
00228 
00229   return false;//no need to filter
00230 }

Bool_t MeuCuts::FilterLowMatTraversed ( const MeuSummary s  )  const

Definition at line 466 of file MeuCuts.cxx.

References Munits::cm, and Munits::s.

Referenced by MeuAnalysis::N_1Plots().

00467 {
00468   const Float_t material01Pl=(5.94)*Munits::cm;//including air gap
00469   const Float_t material16Pl=16*material01Pl;
00470   const Float_t material14Pl=14*material01Pl;
00471 
00472   Bool_t lowMatTrav=true;
00473   
00474   //if a window was completed
00475   if (s.TotalMatTraversed>material16Pl+material14Pl){
00476     lowMatTrav=false;
00477   }
00478   
00479   return lowMatTrav;
00480 }

void MeuCuts::GetBDSelectSpillInfo ( const NtpBDLiteRecord ntpBD,
MeuSummary s,
Int_t  entry,
Int_t &  goodSpillCounter 
) const

Definition at line 1690 of file MeuCuts.cxx.

References BMSpillAna::Config(), RecRecordImp< T >::GetHeader(), BeamDataLiteHeader::GetTimeDiffStreamSpill(), Msg::kInfo, Registry::LockValues(), MAXMSG, Munits::s, BMSpillAna::SelectSpill(), Registry::Set(), BMSpillAna::SetSpill(), NtpBDLiteRecord::tortgt, and Registry::UnLockValues().

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl().

01693 {
01694   static BeamMonSpill spill;
01695   static BMSpillAna bmsa;
01696 
01697   // change default values
01698   static Registry r;
01699   r.UnLockValues();
01700   r.Set("TargetIn",1);
01701   r.Set("BeamType",-1);//don't care if ME,LE,etc
01702   r.LockValues();
01703   bmsa.Config(r);
01704 
01705   bmsa.SetSpill(ntpBD,spill);
01706   s.BDSelectSpill=bmsa.SelectSpill();
01707   
01708   MAXMSG("MeuAnalysis",Msg::kInfo,1)
01709     <<"Setting first fBDSelectSpill... ="<<s.BDSelectSpill
01710     <<", tortgt="<<ntpBD.tortgt
01711     <<", timeDiff="<<ntpBD.GetHeader().GetTimeDiffStreamSpill() 
01712     <<endl;
01713   
01714   static Int_t lastEntry=-1;
01715   if (!s.BDSelectSpill) {
01716     if (entry!=lastEntry) {
01717       MAXMSG("MeuAnalysis",Msg::kInfo,10)
01718         <<"bmsa.SelectSpill()="<<s.BDSelectSpill
01719         <<", tortgt="<<ntpBD.tortgt<<endl;
01720     }
01721   }
01722   else {
01723     //only count new spills, as to events in good spills
01724     if (entry!=lastEntry) goodSpillCounter++;
01725   }
01726   lastEntry=entry;
01727 }

Bool_t MeuCuts::IsAwayFromCoil ( const MeuSummary s,
const std::map< Int_t, MeuHitInfo > &  plInfo,
Float_t *  r = 0 
) const

Definition at line 1638 of file MeuCuts.cxx.

References Msg::kDebug, Detector::kFar, Msg::kInfo, Msg::kWarning, MAXMSG, MSG, and Munits::s.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl().

01640 {
01641   if (s.Detector!=Detector::kFar) {
01642     MAXMSG("MeuCuts",Msg::kInfo,1)
01643       <<"Not running IsAwayFromCoil for detector="<<s.Detector
01644       <<", only needed for FD"<<endl;
01645     return true;
01646   }
01647 
01648   Bool_t awayFromCoil=false;  
01649   Msg::LogLevel_t logLevel=Msg::kDebug;
01650 
01651   if (s.VtxPlane<0 || s.EndPlane<0){
01652     MSG("MeuCuts",Msg::kWarning)
01653       <<"No vtx and/or end plane for this event!"<<endl;
01654     return awayFromCoil;
01655   } 
01656 
01657   Float_t smallestRadius=99999;
01658    
01660   //loop over the planes
01662   typedef map<Int_t,MeuHitInfo>::const_iterator plIter;
01663   for (plIter it=plInfo.begin();it!=plInfo.end();++it){
01664     
01665     const MeuHitInfo& cp=it->second;
01666     
01667     //check if radius is smaller than current smallest
01668     Float_t radius=sqrt(pow(cp.X,2)+pow(cp.Y,2));
01669     if (radius<smallestRadius) smallestRadius=radius;
01670 
01671   }//end of loop over strips
01672 
01673   //analyse coil proximity
01674   if (smallestRadius>s.RFidCoil && smallestRadius<5) awayFromCoil=true;
01675 
01676   MAXMSG("MeuCuts",logLevel,200)
01677     <<"Coil: smallest radius="<<smallestRadius
01678     <<", fRFidCoil="<<s.RFidCoil
01679     <<", awayFromCoil="<<awayFromCoil
01680     <<", vtxPl="<<s.VtxPlane<<", endPl="<<s.EndPlane<<endl;
01681   
01682   //set the output variable
01683   if (r) *r=smallestRadius;
01684 
01685   return awayFromCoil;
01686 }

Bool_t MeuCuts::IsCorrectTrigSrc ( const MeuSummary s  )  const

Definition at line 1623 of file MeuCuts.cxx.

References Detector::kFar, Msg::kInfo, MAXMSG, and Munits::s.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl().

01624 {
01625   //cut out FD spills
01626   if (s.Detector==Detector::kFar && s.TrigSrc>100) {
01627     MAXMSG("MeuCuts",Msg::kInfo,10)
01628       <<"Not using this event, detector="<<s.Detector
01629       <<", trigSrc="<<s.TrigSrc<<endl;
01630     return false;
01631   }
01632   else return true;
01633 }

Bool_t MeuCuts::IsGoodDataQuality ( const NtpStRecord ntp  )  const

Definition at line 3248 of file MeuCuts.cxx.

References NtpSRDataQuality::busychips, NtpSRDataQuality::coldchips, NtpSRDataQuality::cratemask, NtpStRecord::dataquality, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), RecHeader::GetVldContext(), Detector::kFar, NtpSRDataQuality::lisubtractedtime, NtpSRDataQuality::litrigger, and NtpSRDataQuality::trigsource.

03249 {
03250   Bool_t pass = true;
03251   //Only check FD
03252   if (ntp.GetHeader().GetVldContext().GetDetector() != Detector::kFar)
03253     return pass;
03254 
03255   NtpSRDataQuality dataqua = ntp.dataquality;
03256   // Cuts applied to the far detector data in the atmospheric analysis:
03257   // require full readout
03258   pass = pass && dataqua.cratemask == 16;
03259 
03260   // remove spill triggers
03261   pass = pass && dataqua.trigsource < 130000;
03262 
03263   // remove light injection
03264   pass = pass && !( dataqua.litrigger == 1 
03265                     && dataqua.lisubtractedtime > -40000.0 
03266                     && dataqua.lisubtractedtime < +1000.0 );
03267 
03268   // remove events with lots of busy or cold chips
03269   pass = pass && (dataqua.busychips + dataqua.coldchips) < 20;  
03270 
03271   return pass;
03272 
03273 }

Bool_t MeuCuts::IsInPittFidVol ( Float_t  x,
Float_t  y,
Float_t  z,
Float_t  u,
Float_t  v 
) const

Definition at line 76 of file MeuCuts.cxx.

00078 {
00079   // Is the event vertex, (x,y,u,v,z) inside the fiducial volume
00080   // used by the pittsburgh group?
00081   // code from Mike
00082   if( !( z>0.6 && z<3.56) ) return kFALSE;
00083   if( !( u>0.3 && u<1.8) ) return kFALSE;
00084   if( !( v>-1.8 && v< -0.3) ) return kFALSE;
00085   if( x>=2.4) return kFALSE;
00086   const Float_t coil_cut=0.8*0.8;
00087   if( (x*x + y*y) <= coil_cut) return kFALSE;
00088   return kTRUE;
00089 }

void MeuCuts::PrintNtpSt ( const NtpStRecord ntp  )  const

Definition at line 2308 of file MeuCuts.cxx.

References Msg::kInfo, MAXMSG, NtpSRTrack::nstrip, NtpSRTrack::stp, NtpStRecord::stp, and NtpStRecord::trk.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl(), and MeuAnalysis::SpillPlots().

02309 {
02310   TClonesArray& tcaTk=(*ntp.trk);
02311   Int_t numTrks=tcaTk.GetEntries();
02312   TClonesArray& stpTca=(*ntp.stp);
02313   Int_t numStps=stpTca.GetEntries();
02314   
02315   MAXMSG("MeuCuts",Msg::kInfo,200)
02316     <<"PrintNtpSt: numTrks="<<numTrks
02317     <<", total numStps="<<numStps<<endl;
02318   
02319   //Loop over tracks
02320   for (Int_t itrk=0;itrk<numTrks;itrk++){
02321     const NtpSRTrack* ptrk=
02322       dynamic_cast<NtpSRTrack*>(tcaTk[itrk]);
02323     const NtpSRTrack& trk=(*ptrk);
02324       
02325     TClonesArray& stpTca=(*ntp.stp);
02326       
02327     //this loop is just over the tracked strips
02328     for (Int_t i=0;i<trk.nstrip;i++){
02329 
02330       //check for bug where strip index is -1
02331       if (trk.stp[i]<0) {
02332         MAXMSG("MeuCuts",Msg::kInfo,50)
02333           <<"Skipping strip with trk.stp[i]="<<trk.stp[i]<<endl;
02334         continue;
02335       }
02336 
02337       const NtpSRStrip* pstp=
02338         dynamic_cast<NtpSRStrip*>(stpTca[trk.stp[i]]);
02339       const NtpSRStrip& stp=(*pstp);
02340       MAXMSG("NDMeuCuts",Msg::kInfo,20000)
02341         <<"Trk: st="<<stp.strip<<", pl="<<stp.plane
02342         <<", sigCor="<<stp.ph1.sigcor<<", tpos="<<stp.tpos<<endl;
02343     }
02344   }
02345   
02346   //this loop is over ALL the strips
02347   for (Int_t i=0;i<numStps;i++){      
02348     const NtpSRStrip* pstp=dynamic_cast<NtpSRStrip*>(stpTca[i]);
02349     const NtpSRStrip& stp=(*pstp);
02350     
02351     MAXMSG("NDMeuCuts",Msg::kInfo,20000)
02352       <<"All strips: st="<<stp.strip<<", pl="<<stp.plane
02353       <<", sigCor="<<stp.ph1.sigcor<<", tpos="<<stp.tpos<<endl;
02354   }
02355 }

void MeuCuts::SetSpecificCuts ( MeuSummary s  )  const

Definition at line 484 of file MeuCuts.cxx.

References Detector::kFar, Detector::kNear, Munits::m, and Munits::s.

Referenced by MeuAnalysis::MakeSummaryTreeWithNtpStOneSnarl().

00485 {
00486   if (s.Detector==Detector::kNear){
00487     s.RFid=1.0;
00488     s.DistToEdgeFid=0.4;
00489   }
00490   else if (s.Detector==Detector::kFar) {
00491     s.RFid=3.0*Munits::m;
00492     s.RFidCoil=0.5*Munits::m;
00493     s.DistToEdgeFid=1.0*Munits::m;
00494   }
00495   else {
00496     cout<<"Ahhh detector not defined"<<endl;
00497   }
00498 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 00:55:45 2014 for loon by  doxygen 1.4.7