Cutter Class Reference

#include <Cutter.h>

Inheritance diagram for Cutter:
JobCModule

List of all members.

Public Types

typedef bool(Cutter::* CP )() const

Public Member Functions

 Cutter ()
 ~Cutter ()
virtual JobCResult Get (MomNavigator *mom)
virtual JobCResult Ana (const MomNavigator *mom)
virtual void HandleCommand (JobCommand *cmd)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void SetCuts ()
bool SparseErrorCutter () const
bool FafErrorCutter () const
bool TriggerCutter () const
bool TrigPMTCutter () const
bool CosmicCounterCutter () const
bool DeadChipCutter () const
bool OverShootCutter () const
bool KovCutter () const
bool TOFCutter () const
bool TOFTrigCutter () const
bool Kov1TrigCutter () const
bool Kov2TrigCutter () const
bool Kov3TrigCutter () const
bool KovORTrigCutter () const
bool AllKovTrigCutter () const
bool LITrigCutter () const
bool PIDOrTrigCutter () const
bool DeadKovCutter () const
bool NDErrorCutter () const
bool DummyCutter () const
int GetDCPlaneCut () const
int GetMinOST () const
const TH1F * GetCutHistogram () const
void DrawCutHistogram ()
void WriteCutHistogram ()

Private Member Functions

void FillChipsToCut ()

Private Attributes

bool fSparseErrCut
bool fFafErrCut
bool fTrigCut
bool fTPMTCut
bool fCCCut
bool fDCCut
bool fOSCut
bool fKovCut
bool fTOFCut
bool fTOFTrigCut
bool fKov1TrigCut
bool fKov2TrigCut
bool fKov3TrigCut
bool fKovORTrigCut
bool fAllKovTrigCut
bool fLITrigCut
bool fPIDOrTrigCut
bool fDeadKovCut
bool fNDErrorCut
bool fDrawHist
bool fWriteHist
bool fWait
bool fCutsSet
int fKovADCCutLow1
int fKovADCCutHigh1
int fKovADCCutLow2
int fKovADCCutHigh2
int fKovADCCutLow3
int fKovADCCutHigh3
int fDCPlaneCut
int fMinOST
int fFrequency
int fCounter
std::string fFileName
int fRunNumber
std::string fBinLabel [fNCuts+1]
RawRecordfRR
CandCalDetSIHandlefCCDH
TH1F fCutHistogram
TCanvas fCanvas
CP fCutList [fNCuts]
std::set< RawChannelIdfChipsToCut
bool fFilledChipsToCut

Detailed Description

Definition at line 25 of file Cutter.h.


Member Typedef Documentation

typedef bool(Cutter::* Cutter::CP)() const

Definition at line 30 of file Cutter.h.


Constructor & Destructor Documentation

Cutter::Cutter (  ) 

Definition at line 36 of file Cutter.cxx.

References fBinLabel, fCanvas, fCutHistogram, fNCuts, Msg::kDebug, and MSG.

00036               : 
00037   fSparseErrCut(true),
00038   fFafErrCut(true),
00039   fTrigCut(true),  
00040   fTPMTCut(false),
00041   fCCCut(false),
00042   fDCCut(true), 
00043   fOSCut(false),      
00044   fKovCut(false),
00045   fTOFCut(false),
00046   fTOFTrigCut(false),
00047   fKov1TrigCut(false),
00048   fKov2TrigCut(false),
00049   fKov3TrigCut(false),
00050   fKovORTrigCut(false),
00051   fAllKovTrigCut(false),
00052   fLITrigCut(true),
00053   fPIDOrTrigCut(false),
00054   fDeadKovCut(true),
00055   fNDErrorCut(true),
00056   fDrawHist(false),
00057   fWriteHist(false),
00058   fWait(false),
00059   fCutsSet(false),
00060 
00061   fKovADCCutLow1(1),
00062   fKovADCCutHigh1(60000),
00063   fKovADCCutLow2(1),
00064   fKovADCCutHigh2(60000),
00065   fKovADCCutLow3(1),
00066   fKovADCCutHigh3(60000),
00067   fDCPlaneCut(15),
00068   fMinOST(20000),
00069   
00070   fFrequency(100),
00071   fCounter(0),
00072   fFileName("cuts.root"),
00073   fRunNumber(0),
00074   fRR(0),
00075   fCCDH(0),
00076   fCutHistogram("CutHistogram","CutHistogram",fNCuts+1,0,fNCuts+1),
00077   fCanvas("can","can"),
00078   fChipsToCut(),
00079   fFilledChipsToCut(false)
00080   
00081 
00082 {
00083   fCanvas.SetGridx(1);
00084   fCanvas.SetLogy(1);
00085   fCutHistogram.SetNdivisions(510);
00086 
00087 
00088   for(int i=0;i<fNCuts+1;i++){
00089     fBinLabel[i] = "";
00090   }
00091 
00092 
00093   MSG("Cutter",Msg::kDebug)<<"Creating Cutter"<<endl;
00094 }

Cutter::~Cutter (  ) 

Definition at line 99 of file Cutter.cxx.

References Msg::kDebug, and MSG.

00099 {MSG("Cutter",Msg::kDebug)<<"Killing Cutter"<<endl;}


Member Function Documentation

bool Cutter::AllKovTrigCutter (  )  const [inline]

Definition at line 333 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00334 {
00335 
00336   if((fCCDH->GetTrigSource()&0x10)&&(fCCDH->GetTrigSource()&0x20)
00337 &&fCCDH->GetTrigSource()&0x40){
00338     return true;
00339   }
00340 
00341   return false;
00342 }//end AllKovTrigCutter()

JobCResult Cutter::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 141 of file Cutter.cxx.

References DrawCutHistogram(), fBinLabel, fCCDH, fCounter, fCutHistogram, fCutList, fCutsSet, fDrawHist, fFrequency, fNCuts, fRR, fRunNumber, fWait, RawRecord::GetRawHeader(), RawDaqHeader::GetRun(), CandCalDetSIHandle::GetSnarl(), Msg::kDebug, JobCResult::kFailed, Msg::kInfo, JobCResult::kPassed, MSG, and SetCuts().

00142 {
00143 
00144   //  MSG("Cutter",Msg::kDebug)<<"Called Cutter::Ana"<<endl;
00145 
00146   //Note: all cuts return true if event passes cut
00147   if(!fCutsSet){
00148     SetCuts();
00149     fCutsSet=true;
00150   }
00151 
00152   if(fRunNumber==0){
00153     MSG("Cutter",Msg::kDebug)<<"Trying to get RunNumber"<<endl;
00154     const RawDaqHeader* daqhead = 
00155       dynamic_cast <const RawDaqHeader *>(fRR->GetRawHeader());
00156     if(daqhead){
00157       fRunNumber = daqhead->GetRun();
00158       MSG("Cutter",Msg::kDebug)<<fRunNumber<<endl;
00159     }
00160   }
00161   fCounter++;
00162 
00163   int CutNum = 1;
00164   int AllPassed = 0;
00165 
00166   if(fDrawHist){
00167     if(fCounter%fFrequency==0){
00168       DrawCutHistogram();
00169     }
00170   }
00171  
00172   if(fCounter%10000==0){
00173     MSG("Cutter",Msg::kInfo)<<"On Snarl "<<fCCDH->GetSnarl()<<endl;
00174   }
00175 
00176   for(int i=0;i<fNCuts;i++){
00177     if(!(this->*fCutList[i])()){
00178       fCutHistogram.Fill(CutNum+.5);
00179       MSG("Cutter",Msg::kDebug)<<fBinLabel[i+1]<<" Fail"<<endl;
00180       return JobCResult::kFailed;
00181     }
00182     CutNum++;
00183   }//end loop over cuts
00184 
00185 
00186   fCutHistogram.Fill(AllPassed+.5);
00187   MSG("Cutter",Msg::kDebug)<<"Passed all cuts"<<endl;
00188   if(fWait){ //if we want to wait before continuing
00189     MSG("Cutter", Msg::kInfo)<<"After viewing, hit any key to continue"<<endl
00190                              <<"--------------------------------------"<<endl;
00191    
00192     char c;
00193     cin>>c;
00194   }
00195   return JobCResult(JobCResult::kPassed);
00196 
00197 } //end of Ana

void Cutter::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 956 of file Cutter.cxx.

References fFileName, and Registry::Get().

00957 {
00958 //======================================================================
00959 // Configure the module given the Registry r
00960 //======================================================================
00961   const char*    t;
00962   if (r.Get("FileName",t)) { fFileName = t; }
00963 
00964 }

bool Cutter::CosmicCounterCutter (  )  const [inline]

Definition at line 234 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetCosmicCnt().

Referenced by SetCuts().

00235 {
00236 
00237   if(fCCDH->GetCosmicCnt()){//true if there is a cosmic cnt signal
00238     return false;
00239   }
00240   return true;
00241 
00242 }//end CosmicCntCutter

bool Cutter::DeadChipCutter (  )  const

Definition at line 203 of file Cutter.cxx.

References fCCDH, fChipsToCut, CandCalDetSIHandle::GetDeadChips(), Msg::kDebug, and MSG.

Referenced by SetCuts().

00204 {
00205   if(fCCDH->GetDeadChips().size()==0){ //if there are no chips in the vector, 
00206     return true; //passes cut
00207   }
00208 
00209 /*  
00210   const VldContext *vldc = fRR->GetVldContext(); //get Validity context
00211   PlexHandle ph(*vldc);  //use validity context to get a plex handle
00212   MSG("Cutter",Msg::kDebug)<<"Validity context "<<*vldc<<endl;
00213   for(UShort_t i=0; i<(fCCDH->GetDeadChips()).size();i++){
00214     Int_t crate = (fCCDH->GetDeadChips())[i].GetCrate();
00215     Int_t varc = (fCCDH->GetDeadChips())[i].GetVarcId();
00216     Int_t vmm = (fCCDH->GetDeadChips())[i].GetVmm();
00217     Int_t vaadc = (fCCDH->GetDeadChips())[i].GetVaAdcSel();
00218     Int_t chip = (fCCDH->GetDeadChips())[i].GetVaChip();
00219     MSG("Cutter",Msg::kDebug)<<"Dead Chips"<<endl
00220                              <<varc<<","<<vmm<<","<<vaadc<<","<<vaadc<<","<<chip<<endl;
00221     //create new channel Id with a valid channel 
00222     //channel 0 is given in the DeadChip vector, but is not mapped to a plane-strip 
00223     const RawChannelId newchan(Detector::kCalDet, 
00224                                ElecType::kVA, crate,varc, vmm, vaadc, chip, 2, kFALSE, kFALSE);
00225     PlexStripEndId pse = ph.GetSEIdAltL(newchan).GetBestSEId(); //use ph to get stripendid
00226     int plane = pse.GetPlane(); //use stripend id to get plane
00227     MSG("Cutter",Msg::kDebug)<<"Plane: "<<plane<<" Cut "<<fDCPlaneCut<<endl;
00228     if(plane<fDCPlaneCut){// if there is a dead chip in a plane less than fDCPlaneCut
00229       return false; //fails cut
00230     }
00231     if(chip==1){ //chip 1 spans two different planes, channel 5 goes to the other plane
00232       const RawChannelId newchan(Detector::kCalDet, 
00233                                ElecType::kVA, crate,varc, vmm, vaadc, chip, 5, kFALSE, kFALSE);
00234       PlexStripEndId pse = ph.GetSEIdAltL(newchan).GetBestSEId(); //use ph to get stripendid
00235       int plane = pse.GetPlane(); //use stripend id to get plane
00236       MSG("Cutter",Msg::kDebug)<<"Plane: "<<plane<<" Cut "<<fDCPlaneCut<<endl;
00237       if(plane<fDCPlaneCut){// if there is a dead chip in a plane less than fDCPlaneCut
00238         return false; //fails cut
00239       }
00240     }
00241       
00242   }//end loop over vector elements
00243         
00244 */
00245 
00246   
00247   MSG("Cutter",Msg::kDebug)<<"Looking for DEAD CHIPS "<<endl;
00248 /*
00249   vector<const RawChannelId>::iterator dcit = fCCDH->GetDeadChips().begin();
00250   while(dcit!=fCCDH->GetDeadChips().end()){
00251     MSG("Cutter",Msg::kDebug)<<*dcit<<endl;
00252     dcit++;
00253   }
00254   MSG("Cutter",Msg::kDebug)<<"In the following list "<<endl;
00255   set<RawChannelId>::iterator ctcit = fChipsToCut.begin();
00256   while(ctcit!=fChipsToCut.end()){
00257     MSG("Cutter",Msg::kDebug)<<*ctcit<<endl;
00258     ctcit++;
00259   }
00260 */
00261   MSG("Cutter",Msg::kDebug)<<"The dead chips are:"<<endl;;
00262   for(unsigned int i=0;i<fCCDH->GetDeadChips().size();i++){
00263      MSG("Cutter",Msg::kDebug)<<fCCDH->GetDeadChips()[i]<<endl;
00264   }
00265   
00266   std::set<RawChannelId>::iterator ctci(fChipsToCut.begin());
00267   MSG("Cutter",Msg::kDebug)<<"The chips in the list of chips to cut are:"<<endl;
00268   while(ctci!=fChipsToCut.end()){
00269      MSG("Cutter",Msg::kDebug)<<*ctci<<endl;
00270      ctci++;
00271   }
00272 
00273   if(find_first_of(fChipsToCut.begin(),
00274                     fChipsToCut.end(), 
00275                     fCCDH->GetDeadChips().begin(), 
00276                     fCCDH->GetDeadChips().end())!= fChipsToCut.end())
00277      {
00278 
00279        MSG("Cutter",Msg::kDebug)<<"FOUND DEAD CHIPS "<<endl
00280                                 <<"Size of DCVector "<<fCCDH->GetDeadChips().size()
00281                                 <<" first entry "<<(fCCDH->GetDeadChips())[0]
00282                                 <<endl;
00283        MSG("Cutter",Msg::kDebug)<<"Dead chips "
00284                                 <<*find_first_of(fChipsToCut.begin(),
00285                                                  fChipsToCut.end(),
00286                                                  fCCDH->GetDeadChips().begin(), 
00287                                                  fCCDH->GetDeadChips().end())
00288                                 <<endl;
00289        return false;
00290      }
00291    
00292   
00293       
00294   return true; //no dead chips, passes cut
00295 }//End DeadChipCutter()

bool Cutter::DeadKovCutter (  )  const

Definition at line 298 of file Cutter.cxx.

References fCCDH, CandCalDetSIHandle::GetCerenkovChannel1(), CandCalDetSIHandle::GetCerenkovChannel2(), CandCalDetSIHandle::GetCerenkovChannel3(), CandCalDetSIHandle::GetDeadChips(), it, ElecType::kQIE, and ElecType::kVA.

Referenced by SetCuts().

00299 {
00300 
00301   if(fCCDH->GetDeadChips().size()==0){ //if there are no chips in the vector, 
00302     return true; //passes cut
00303   }
00304 
00305   vector<RawChannelId>::const_iterator it(fCCDH->GetDeadChips().begin());
00306   while(it!=fCCDH->GetDeadChips().end()){
00307      if(it->GetElecType()==ElecType::kVA
00308         &&fCCDH->GetCerenkovChannel1()==ElecType::kVA){
00309         if(it->IsSameVAChip(fCCDH->GetCerenkovChannel1())){
00310            return false;
00311         }
00312      }
00313      else if(it->GetElecType()==ElecType::kQIE
00314              &&fCCDH->GetCerenkovChannel1()==ElecType::kQIE){
00315         if(it->IsSameChannel(fCCDH->GetCerenkovChannel1())){
00316            return false;
00317         }
00318      }
00319      if(it->GetElecType()==ElecType::kVA
00320         &&fCCDH->GetCerenkovChannel2()==ElecType::kVA){
00321         if(it->IsSameVAChip(fCCDH->GetCerenkovChannel2())){
00322            return false;
00323         }
00324      }
00325      else if(it->GetElecType()==ElecType::kQIE
00326              &&fCCDH->GetCerenkovChannel2()==ElecType::kQIE){
00327         if(it->IsSameChannel(fCCDH->GetCerenkovChannel2())){
00328            return false;
00329         }
00330      }
00331      if(it->GetElecType()==ElecType::kVA
00332         &&fCCDH->GetCerenkovChannel3()==ElecType::kVA){
00333         if(it->IsSameVAChip(fCCDH->GetCerenkovChannel3())){
00334            return false;
00335         }
00336      }
00337      else if(it->GetElecType()==ElecType::kQIE
00338              &&fCCDH->GetCerenkovChannel3()==ElecType::kQIE){
00339         if(it->IsSameChannel(fCCDH->GetCerenkovChannel3())){
00340            return false;
00341         }
00342      }
00343 
00344     it++;
00345   }
00346   
00347   return true;
00348   
00349 }//End DeadKovCutter

const Registry & Cutter::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 968 of file Cutter.cxx.

References JobCModule::GetName(), Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00969 {
00970 //======================================================================
00971 // Supply the default configuration for the module
00972 //======================================================================
00973   static Registry r; // Default configuration for module
00974 
00975   // Set name of config
00976   std::string name = this->JobCModule::GetName();
00977   name += ".config.default";
00978   r.SetName(name.c_str());
00979 
00980   // Set values in configuration
00981   r.UnLockValues();
00982 
00983   const char* s = "cuts.root";
00984   r.Set("FileName", s);
00985   
00986   r.LockValues();
00987 
00988   return r;
00989 }

void Cutter::DrawCutHistogram (  ) 

Definition at line 423 of file Cutter.cxx.

References fBinLabel, fCanvas, fCutHistogram, Msg::kDebug, and MSG.

Referenced by Ana(), and HandleCommand().

00424 {
00425   fCanvas.cd();
00426   fCutHistogram.Draw();
00427   TText t;
00428   t.SetTextAngle(90);
00429   t.SetTextSize(.035);
00430   t.SetTextAlign(33);
00431 //  t.SetTextFont(12);
00432   Float_t y = (fCanvas.GetUymax()+fCanvas.GetUymin())/2.;
00433   for(int i=0;i<fCutHistogram.GetNbinsX();i++){
00434     const char* temp = fBinLabel[i].c_str();
00435     char name[100];
00436     strcpy(name, temp);
00437     Float_t x = fCutHistogram.GetXaxis()->GetBinCenter(i+1);
00438     MSG("Cutter",Msg::kDebug)<<"*"<<name<<endl;
00439     t.DrawText(x,y,name);
00440   }
00441 //  fCanvas.Update();
00442   
00443 }//end DrawCutHistogram

bool Cutter::DummyCutter (  )  const [inline]

Definition at line 107 of file Cutter.h.

Referenced by SetCuts().

00107 {return true;}

bool Cutter::FafErrorCutter (  )  const [inline]

Definition at line 185 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetFafErr().

Referenced by SetCuts().

00186 {
00187 
00188   if(fCCDH->GetFafErr()){ //true if there is a faf error
00189     return false;
00190   }
00191 
00192   return true; //if we get here, no errors, passes cut
00193 }//end FafErrorCutter()

void Cutter::FillChipsToCut (  )  [private]

Definition at line 840 of file Cutter.cxx.

References RawChannelId::CalcChAdd(), fChipsToCut, fDCPlaneCut, fRR, VldContext::GetDetector(), RawChannelId::GetElecType(), RawChannelId::GetGeographicAddress(), RawChannelId::GetMasterChannel(), PlexHandle::GetRawChannelId(), RawChannelId::GetVaAdcSel(), RawChannelId::GetVaChip(), RawChannelId::GetVarcId(), RecMinos::GetVldContext(), RawChannelId::GetVmm(), Detector::kCalDet, Msg::kDebug, StripEnd::kNegative, StripEnd::kPositive, ElecType::kQIE, ElecType::kVA, MSG, and RawChannelId::SetChAdd().

Referenced by Get().

00841 {
00842 // fill fChipsToCut with the RawChannelId's (chan==0) for all chips
00843 // whose plane<fDCPlaneCut
00844 
00845 
00846 // get a plex handle
00847      const VldContext *vldc = fRR->GetVldContext(); //get Validity context
00848      PlexHandle ph(*vldc);  //use validity context to get a plex handle
00849      Detector::Detector_t detector = vldc->GetDetector();
00850      MSG("Cutter",Msg::kDebug)<<"The VldContext in  Fill chips to cut is:"
00851                               <<*vldc<<endl;
00852      for(Int_t plane=0; plane<fDCPlaneCut; plane++){
00853           // how many strips in a plane?
00854           // currently broken for everything but the caldet
00855           Int_t nstrips = 0;
00856           switch(detector) {
00857           case Detector::kCalDet:
00858                nstrips=24;
00859                break;
00860           default:
00861                break;
00862           }
00863 
00864 // for now, do this for every strip
00865           for(Int_t strip=0; strip<nstrips; strip++) {
00866                PlexStripEndId pseid_pos(detector, plane, 
00867                                         strip, StripEnd::kPositive);
00868                PlexStripEndId pseid_neg(detector, plane, 
00869                                         strip, StripEnd::kNegative);
00870                RawChannelId chip_pos = ph.GetRawChannelId(pseid_pos);
00871                RawChannelId chip_neg = ph.GetRawChannelId(pseid_neg);
00872 
00873                MSG("Cutter",Msg::kDebug)<<" The real rawchan id (before changing) "
00874                                         <<plane<<" strip "<<strip<<endl;
00875                MSG("Cutter",Msg::kDebug)<<"pos "<<chip_pos<<endl
00876                                         <<"neg "<<chip_neg<<endl;
00877 
00878                
00879 
00880                if(chip_pos.GetElecType()==ElecType::kVA){
00881                   // convert to "chip" (a RawChannelId with chan=0)
00882                   MSG("Cutter",Msg::kDebug)<<"positive va"<<endl;
00883                   chip_pos.SetChAdd(
00884                      chip_pos.CalcChAdd(chip_pos.GetVarcId(),chip_pos.GetVmm(),
00885                                         chip_pos.GetVaAdcSel(),
00886                                         chip_pos.GetVaChip(),0));
00887                }
00888                if(chip_pos.GetElecType()==ElecType::kQIE){
00889                   MSG("Cutter",Msg::kDebug)<<"positive qie"<<endl;
00890                   //phil will give me the first masterchannel, minder channel
00891                   //combo of a dead pmt which will either be a 0 or a 4 for 
00892                   //master channel, and a 0 for minder channel
00893                   chip_pos.SetChAdd(
00894                      chip_pos.CalcChAdd(chip_pos.GetGeographicAddress(),
00895                                         ((int)(chip_pos.GetMasterChannel()/4))*4,
00896                                         0));
00897                }
00898                if(chip_neg.GetElecType()==ElecType::kVA){
00899                   MSG("Cutter",Msg::kDebug)<<"neg va"<<endl;
00900                   chip_neg.SetChAdd(
00901                      chip_neg.CalcChAdd(chip_neg.GetVarcId(),chip_neg.GetVmm(),
00902                                         chip_neg.GetVaAdcSel(),
00903                                         chip_neg.GetVaChip(),0));
00904                }
00905                if(chip_neg.GetElecType()==ElecType::kQIE){
00906                   MSG("Cutter",Msg::kDebug)<<"neg qie"<<endl;
00907                   chip_neg.SetChAdd(
00908                      chip_neg.CalcChAdd(chip_neg.GetGeographicAddress(),
00909                                         ((int)(chip_neg.GetMasterChannel()/4))*4,
00910                                         0));
00911 
00912                }
00913                // insert the "chips" into fChipsToCut
00914                MSG("Cutter",Msg::kDebug)<<" inserting chips for plane "
00915                                         <<plane<<" strip "<<strip<<endl;
00916                MSG("Cutter",Msg::kDebug)<<"pos "<<chip_pos<<endl
00917                                         <<"neg "<<chip_neg<<endl;
00918                fChipsToCut.insert(chip_pos);
00919                fChipsToCut.insert(chip_neg);
00920           }
00921      }
00922      return;
00923 
00924 }

JobCResult Cutter::Get ( MomNavigator mom  )  [virtual]

Implement if your module needs to read data from some external source and fill mom

Reimplemented from JobCModule.

Definition at line 103 of file Cutter.cxx.

References fCCDH, fFilledChipsToCut, FillChipsToCut(), CandRecord::FindCandHandle(), RawRecord::FindRawBlock(), fRR, MomNavigator::GetFragment(), Msg::kError, JobCResult::kFailed, JobCResult::kPassed, and MSG.

00104 {
00105   //  MSG("Cutter",Msg::kDebug)<<"Called Cutter::Get"<<endl;
00106 
00107   //ask mom for a RawRecord
00108   fRR = dynamic_cast<RawRecord *>(mom->GetFragment("RawRecord"));
00109   if(fRR==0){ //couldn't get a rawrecord
00110     MSG("Cutter", Msg::kError)<<"Could not retrieve a RawRecord from Mom"<<endl;
00111     return JobCResult(JobCResult::kFailed);
00112   }
00113   if(fRR->FindRawBlock("RawDigitDataBlock")==0){
00114      MSG("Cutter", Msg::kError)<<"Not a RawDigitDataBlock"<<endl;
00115      return JobCResult(JobCResult::kFailed);
00116   }
00117 
00118   //ask mom for a candrecord
00119   CandRecord *cr = dynamic_cast<CandRecord *>(mom->GetFragment("CandRecord"));
00120   if(cr==0){
00121     return JobCResult(JobCResult::kFailed);
00122   }
00123 
00124   //get the candcaldetsihandle from the candrecord
00125   fCCDH = dynamic_cast<CandCalDetSIHandle *>(cr->FindCandHandle("CandCalDetSIHandle"));
00126   if(fCCDH==0){ //couldn't get a CandCalDetSIHandle
00127     MSG("Cutter", Msg::kError)<<"Could not retrieve a CandCalDetSIHandle from Mom"<<endl;
00128     return JobCResult(JobCResult::kFailed);
00129   }
00130 
00131   if(!fFilledChipsToCut){
00132        FillChipsToCut();
00133        fFilledChipsToCut=true;
00134   }
00135 
00136   return JobCResult(JobCResult::kPassed);  //success in retrieving a raw record and CandCalDetSIHandle
00137 } //end of Get

const TH1F* Cutter::GetCutHistogram (  )  const [inline]

Definition at line 114 of file Cutter.h.

References fCutHistogram.

00114 {return &fCutHistogram;} //get the cut Histogram

int Cutter::GetDCPlaneCut (  )  const [inline]

Definition at line 112 of file Cutter.h.

References fDCPlaneCut.

00112 {return fDCPlaneCut;}   //get the plane cut on dead chips

int Cutter::GetMinOST (  )  const [inline]

Definition at line 113 of file Cutter.h.

References fMinOST.

00113 {return fMinOST;}           //get the minimum overshoot time

void Cutter::HandleCommand ( JobCommand command  )  [virtual]

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 477 of file Cutter.cxx.

References DrawCutHistogram(), fAllKovTrigCut, fCCCut, fDCCut, fDCPlaneCut, fDrawHist, fFafErrCut, fFileName, fFrequency, fKov1TrigCut, fKov2TrigCut, fKov3TrigCut, fKovADCCutHigh1, fKovADCCutHigh2, fKovADCCutLow1, fKovADCCutLow2, fKovCut, fKovORTrigCut, fLITrigCut, fMinOST, fNDErrorCut, fOSCut, fPIDOrTrigCut, fSparseErrCut, fTOFCut, fTOFTrigCut, fTPMTCut, fTrigCut, fWait, JobCommand::PopCmd(), JobCommand::PopOpt(), and WriteCutHistogram().

00478 {
00479 
00480   const char* c = cmd->PopCmd();
00481   if (c) {
00482     string sc(c);
00483     //  if(sc == "SetCutList"){
00484     //SetCutList();
00485     //}
00486     if(sc == "Wait"){
00487       fWait = true;
00488     }
00489 
00490     if(sc == "NoWait"){
00491       fWait = false;
00492     }
00493 
00494     if (sc == "SetDrawFreq") {
00495       fDrawHist = true;
00496       fFrequency = atoi(cmd->PopOpt());
00497     }
00498 
00499     if(sc == "SetFileName"){
00500       fFileName = cmd->PopOpt();
00501     }
00502 
00503     if(sc == "WriteHistogram"){
00504       WriteCutHistogram();
00505     }
00506     
00507     if(sc == "DrawHistogram"){
00508       DrawCutHistogram();
00509     }
00510 
00511     if(sc == "CutON"){
00512       string cutname = cmd->PopOpt();
00513       if(cutname == "SparseErrCut"){
00514         fSparseErrCut=true;
00515       }
00516       if(cutname == "FafErrCut"){
00517         fFafErrCut=true;
00518       }
00519       if(cutname == "TrigCut"){
00520         fTrigCut=true;
00521       }
00522       if(cutname == "TriggerPMTCut"){
00523         //cout<<"Setting TriggerPMTCUT to true"<<endl;
00524         fTPMTCut=true;
00525       }
00526       if(cutname == "CosmicCntCut"){
00527         fCCCut=true;
00528       }
00529       if(cutname == "DeadChipCut"){
00530         fDCCut=true;
00531       }
00532       if(cutname == "UnderShootCut"){
00533         fOSCut=true;
00534       }
00535       if(cutname == "KovCut1"){
00536         fKovCut=true;
00537         fKovADCCutLow1 = atoi(cmd->PopOpt());
00538         fKovADCCutHigh1 = atoi(cmd->PopOpt());
00539       }
00540       if(cutname == "KovCut2"){
00541         fKovCut=true;
00542         fKovADCCutLow2 = atoi(cmd->PopOpt());
00543         fKovADCCutHigh2 = atoi(cmd->PopOpt());
00544       }
00545       if(cutname == "TOFCut"){
00546         fTOFCut=true;
00547       }
00548       if(cutname == "TOFTrigCut"){
00549         fTOFTrigCut=true;
00550       }
00551       if(cutname=="Kov1TrigCut"){
00552         fKov1TrigCut=true;
00553       }
00554       if(cutname=="Kov2TrigCut"){
00555         fKov2TrigCut=true;
00556       }
00557       if(cutname=="Kov3TrigCut"){
00558         fKov3TrigCut=true;
00559       }
00560       if(cutname=="KovORTrigCut"){
00561         fKovORTrigCut=true;
00562       }
00563       if(cutname=="AllKovTrigCut"){
00564         fAllKovTrigCut = true;
00565       }
00566       if(cutname=="PIDOrTrigCut"){
00567         fPIDOrTrigCut = true;
00568       }
00569       if(cutname=="LITrigCut"){
00570         fLITrigCut = true;
00571       }
00572       if(cutname == "NDErrorCut"){
00573         fNDErrorCut=true;
00574       }
00575     }//end cuton
00576     
00577     if(sc == "SetCutValue"){
00578       string cutname = cmd->PopOpt();
00579       if(cutname == "DeadChipCut"){
00580         fDCPlaneCut = atoi(cmd->PopOpt());
00581       }
00582       if(cutname == "UnderShootCut"){
00583         fMinOST = atoi(cmd->PopOpt());
00584       }
00585     }//end setcutvalue
00586 
00587     if(sc == "CutOFF"){
00588       string cutname = cmd->PopOpt();
00589       if(cutname == "SparseErrCut"){
00590         fSparseErrCut=false;
00591       }
00592       if(cutname == "FafErrCut"){
00593         fFafErrCut=false;
00594       }
00595       if(cutname == "TrigCut"){
00596         fTrigCut=false;
00597       }
00598       if(cutname == "TriggerPMTCut"){
00599         fTPMTCut=false;
00600       }
00601       if(cutname == "CosmicCntCut"){
00602         fCCCut=false;
00603       }
00604       if(cutname == "DeadChipCut"){
00605         fDCCut=false;
00606       }
00607       if(cutname == "UnderShootCut"){
00608         fOSCut=false;
00609       }
00610       if(cutname == "KovCut"){
00611         fKovCut=false;
00612       }
00613       if(cutname == "TOFCut"){
00614         fTOFCut=false;
00615       }
00616       if(cutname == "TOFTrigCut"){
00617         fTOFTrigCut=false;
00618       }
00619       if(cutname=="Kov1TrigCut"){
00620         fKov1TrigCut=false;
00621       }
00622       if(cutname=="Kov2TrigCut"){
00623         fKov2TrigCut=false;
00624       }
00625       if(cutname=="Kov3TrigCut"){
00626         fKov2TrigCut=false;
00627       }
00628       if(cutname=="KovORTrigCut"){
00629         fKov2TrigCut=false;
00630       }
00631       if(cutname=="AllKovTrigCut"){
00632         fAllKovTrigCut = false;
00633       }
00634       if(cutname=="PIDOrTrigCut"){
00635         fPIDOrTrigCut = false;
00636       }
00637       if(cutname=="LITrigCut"){
00638         fLITrigCut = false;
00639       }
00640       if(cutname == "NDErrorCut"){
00641         fNDErrorCut=false;
00642       }
00643 
00644 
00645     }//end cutoff
00646 
00647   }//end commandcheck
00648   return;
00649 }//end HandleCommand

bool Cutter::Kov1TrigCutter (  )  const [inline]

Definition at line 284 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00285 {
00286 
00287   if(fCCDH->GetTrigSource()&0x10){
00288     return true;
00289   }
00290 
00291   return false;
00292 }//end Kov1TrigCutter()

bool Cutter::Kov2TrigCutter (  )  const [inline]

Definition at line 296 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00297 {
00298 
00299   if(fCCDH->GetTrigSource()&0x20){
00300     return true;
00301   }
00302  
00303   return false;
00304 }//end Kov2TrigCutter()

bool Cutter::Kov3TrigCutter (  )  const [inline]

Definition at line 307 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00308 {
00309 
00310   if(fCCDH->GetTrigSource()&0x40){
00311     return true;
00312   }
00313  
00314   return false;
00315 }//end Kov3TrigCutter()

bool Cutter::KovCutter (  )  const [inline]

Definition at line 246 of file Cutter.h.

References fCCDH, fKovADCCutHigh1, fKovADCCutHigh2, fKovADCCutHigh3, fKovADCCutLow1, fKovADCCutLow2, fKovADCCutLow3, CandCalDetSIHandle::GetKovADC1(), CandCalDetSIHandle::GetKovADC2(), and CandCalDetSIHandle::GetKovADC3().

Referenced by SetCuts().

00247 {
00248 
00249   if((fCCDH->GetKovADC1()>fKovADCCutLow1&&fCCDH->GetKovADC1()<fKovADCCutHigh1)
00250      ||(fCCDH->GetKovADC2()>fKovADCCutLow2&&fCCDH->GetKovADC2()<fKovADCCutHigh2)||(fCCDH->GetKovADC3()>fKovADCCutLow3&&fCCDH->GetKovADC3()<fKovADCCutHigh3)){//if there is non-zero adc on cernekov, there was a hit in kov
00251     return true;
00252   }
00253   return false;
00254 
00255 } //end KovCutter

bool Cutter::KovORTrigCutter (  )  const [inline]

Definition at line 319 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00320 {
00321 
00322   if(fCCDH->GetTrigSource()&0x10||fCCDH->GetTrigSource()&0x20
00323      ||fCCDH->GetTrigSource()&0x40){
00324     return true;
00325   }
00326  
00327   return false;
00328 }//end KovORTrigCutter()

bool Cutter::LITrigCutter (  )  const [inline]

Definition at line 345 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00346 {
00347 
00348   if(fCCDH->GetTrigSource()&0x02){
00349     return false;
00350   }
00351   
00352   return true;
00353 }//end LITrigCutter()

bool Cutter::NDErrorCutter (  )  const

Definition at line 927 of file Cutter.cxx.

References RawDigitDataBlock::At(), RawRecord::FindRawBlock(), fRR, RawDigit::GetChannel(), RawChannelId::GetElecType(), RawDigit::GetErrorCode(), RawDigitDataBlock::GetNumberOfDigits(), and ElecType::kQIE.

Referenced by SetCuts().

00928 {
00929 
00930 // no data, no problem
00931 if(!fRR) return true;
00932 
00933 // fetch raw datablock
00934 const RawDigitDataBlock* r = 
00935     dynamic_cast<const RawDigitDataBlock*>
00936     (fRR->FindRawBlock("RawDigitDataBlock"));
00937 
00938 // no data, no problem
00939 if(!r) return true;
00940 
00941 // loop through digits
00942 // if digit is qie and the error code !=0 then there is an error
00943 
00944 bool error = false;
00945 const Int_t ndig=r->GetNumberOfDigits();
00946 for(int i=0; i<ndig; i++){
00947     const RawDigit* d = r->At(i); 
00948     if( (d->GetChannel().GetElecType()==ElecType::kQIE)
00949         &&(d->GetErrorCode()!=0) ) { error=true; break;}
00950     }
00951 
00952 return !(error);
00953 }

bool Cutter::OverShootCutter (  )  const

Definition at line 353 of file Cutter.cxx.

References RawDigitDataBlock::At(), fCCDH, fMinOST, fRR, RawDataBlock::GetBlockId(), RawDigit::GetChannel(), RawBlockId::GetMajor(), RawDigitDataBlock::GetNumberOfDigits(), RawRecord::GetRawBlockIter(), CandCalDetSIHandle::GetUnderShootChips(), kMdBlockCrateReadout, and UtilStrip::NDigits().

Referenced by SetCuts().

00354 {
00355   TIter rbi = fRR->GetRawBlockIter();
00356 
00357   while(TObject* obj = rbi.Next()){
00358     //cast iterator object to a RawDataBlock
00359     const RawDataBlock* rdb=dynamic_cast<RawDataBlock *>(obj);
00360     if(rdb==0){ //if cast fails
00361       continue;
00362     }
00363     //Get the RawBlockID
00364 /*
00365     RawBlockId bid=rdb->GetBlockId();
00366     int maj=bid.GetMajor();
00367 */
00368      //Compare result of GetMajor to kMdBlockCrateReadout
00369     if(rdb->GetBlockId().GetMajor()==kMdBlockCrateReadout){ 
00370       //if we find a datablock, cast to a RawDigitDataBlock
00371       const RawDigitDataBlock* data = dynamic_cast<RawDigitDataBlock *>(obj);
00372       if(data==0){ //if cast doesn't work
00373         continue;
00374       }
00375       Int_t NDigits = data->GetNumberOfDigits();
00376       for(Int_t i=0;i<NDigits;i++){ //iterate over digits in the snarl
00377 /*
00378         const RawDigit *digit = data->At(i);
00379         RawChannelId cid = digit->GetChannel();
00380         
00381         map<RawChannelId, Int_t>::const_iterator mit=fCCDH->GetUnderShootChips().begin();
00382         while(mit!=fCCDH->GetUnderShootChips().end()){
00383           MSG("Cutter",Msg::kDebug)<<"UnderShoot Chips"<<" "
00384                                    <<mit->first.GetCrate()<<","<<mit->first.GetVarcId()
00385                                    <<","<<mit->first.GetVaAdcSel()<<","<<mit->first.GetVaChip()
00386                                    <<","<<mit->first.GetVaChannel()<<" ticks "<<mit->second<<endl
00387                                    <<"This Chip"<<" "
00388                                    <<cid.GetCrate()<<","<<cid.GetVarcId()
00389                                    <<","<<cid.GetVaAdcSel()<<","<<cid.GetVaChip()
00390                                    <<","<<cid.GetVaChannel()<<" ticks "<<mit->second<<endl;
00391           if(cid.GetChAdd()==mit->first.GetChAdd()){ //if current chan. id is in Undershoot map
00392             MSG("Cutter",Msg::kDebug)<<"Found matching Chips"<<endl;
00393             MSG("Cutter",Msg::kDebug)<<"Ticks "<<mit->second<<" cut "<<fMinOST<<endl;
00394             if(mit->second<fMinOST){ //compare time of Undershoot to cut value
00395               MSG("Cutter",Msg::kDebug)<<"Failed time cut"<<endl;
00396               return false; //there is a chip in the undershoot period
00397             }
00398           }
00399 
00400           mit++;
00401         }//end iteration on UnderShoot map
00402 */
00403 
00404 // This should be much more efficient that iterating through the map
00405 // (log(n) vs n) where n = # overshoot chips
00406 // one could add the debugging output back in if desired
00407          map<RawChannelId, Int_t>::const_iterator mit =
00408               fCCDH->GetUnderShootChips().find(data->At(i)->GetChannel());
00409          if(mit==fCCDH->GetUnderShootChips().end() || mit->second>fMinOST) {}// do nothing
00410          else return false; // fail this snarl
00411 
00412         
00413       }//end loop on snarl digits
00414     }//end if kMdBlockCrateReadout
00415   }//end iteration over raw blocks
00416 
00417   return true;
00418 
00419 }

bool Cutter::PIDOrTrigCutter (  )  const [inline]

Definition at line 357 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00358 {
00359 
00360   if(fCCDH->GetTrigSource()&0x08
00361      ||fCCDH->GetTrigSource()&0x10
00362      ||fCCDH->GetTrigSource()&0x20
00363      ||fCCDH->GetTrigSource()&0x40){
00364     return true;
00365   }
00366 
00367   return false;
00368 }//end PIDOrTrigCutter

void Cutter::SetCuts (  ) 

Definition at line 653 of file Cutter.cxx.

References AllKovTrigCutter(), CosmicCounterCutter(), DeadChipCutter(), DeadKovCutter(), DummyCutter(), FafErrorCutter(), fAllKovTrigCut, fBinLabel, fCCCut, fCutList, fDCCut, fDCPlaneCut, fDeadKovCut, fFafErrCut, fKov1TrigCut, fKov2TrigCut, fKov3TrigCut, fKovCut, fKovORTrigCut, fLITrigCut, fMinOST, fNCuts, fNDErrorCut, fOSCut, fPIDOrTrigCut, fSparseErrCut, fTOFCut, fTOFTrigCut, fTPMTCut, fTrigCut, Msg::kInfo, Kov1TrigCutter(), Kov2TrigCutter(), Kov3TrigCutter(), KovCutter(), KovORTrigCutter(), LITrigCutter(), MSG, NDErrorCutter(), OverShootCutter(), PIDOrTrigCutter(), SparseErrorCutter(), TOFCutter(), TOFTrigCutter(), TriggerCutter(), and TrigPMTCutter().

Referenced by Ana().

00654 {
00655 
00656   MSG("Cutter",Msg::kInfo)<<"THE CUTS ARE SET AS FOLLOWS:"<<endl
00657                           <<"____________________________"<<endl
00658                           <<"Dead Chip Cut "<<(int)fDCCut<<" Less than plane "<<fDCPlaneCut<<endl                        
00659                           <<"UnderShoot Cut "<<(int)fOSCut<<" more than "<<fMinOST<<" ticks"<<endl
00660                           <<"SparseErrCut "<<(int)fSparseErrCut<<endl
00661                           <<"FafErrCut "<<(int)fFafErrCut<<endl
00662                           <<"KovCut "<<(int)fKovCut<<endl
00663                           <<"TOFCut "<<(int)fTOFCut<<endl
00664                           <<"TrigCut "<<(int)fTrigCut<<endl
00665                           <<"TOFTrigCut"<<(int)fTOFTrigCut<<endl
00666                           <<"Kov1TrigCut"<<(int)fKov1TrigCut<<endl
00667                           <<"Kov2TrigCut"<<(int)fKov2TrigCut<<endl
00668                           <<"Kov3TrigCut"<<(int)fKov3TrigCut<<endl
00669                           <<"KovORTrigCut"<<(int)fKovORTrigCut<<endl
00670                           <<"AllKovTrigCut"<<(int)fAllKovTrigCut<<endl
00671                           <<"CosmicCntCut "<<(int)fCCCut<<endl          
00672                           <<"TriggerPMTCut "<<(int)fTPMTCut<<endl
00673                           <<"LITriggerCut "<<(int)fLITrigCut<<endl
00674                           <<"PIDOrTrigCut "<<(int)fPIDOrTrigCut<<endl
00675                           <<"DeadKovCut "<<(int)fDeadKovCut<<endl
00676                           <<"NDErrorCut "<<(int)fNDErrorCut<<endl;
00677 
00678   fBinLabel[0] = "PA";
00679   if(fTrigCut){
00680     fCutList[0] = &Cutter::TriggerCutter;
00681     fBinLabel[1] = "Trig";
00682   }
00683   else{
00684     fCutList[0] = &Cutter::DummyCutter;
00685   }
00686 
00687   if(fTOFTrigCut){
00688     fCutList[1] = &Cutter::TOFTrigCutter;
00689     fBinLabel[2] = "TOFTrig";
00690   }
00691   else{
00692         fCutList[1] = &Cutter::DummyCutter;
00693   }
00694 
00695   if(fKov1TrigCut){
00696     fCutList[2] = &Cutter::Kov1TrigCutter;
00697     fBinLabel[3] = "Kov1Trig";
00698   }
00699   else{
00700     fCutList[2] = &Cutter::DummyCutter;
00701   }
00702 
00703   if(fKov2TrigCut){
00704     fCutList[3] = &Cutter::Kov2TrigCutter;
00705     fBinLabel[4] = "Kov2Trig";    
00706   }
00707   else{
00708     fCutList[3] = &Cutter::DummyCutter;
00709   }
00710 
00711   if(fKov3TrigCut){
00712     fCutList[4] = &Cutter::Kov3TrigCutter;
00713     fBinLabel[5] = "Kov3Trig";    
00714   }
00715   else{
00716     fCutList[4] = &Cutter::DummyCutter;
00717   }
00718 
00719   if(fKovORTrigCut){
00720     fCutList[5] = &Cutter::KovORTrigCutter;
00721     fBinLabel[6] = "KovORTrig";    
00722   }
00723   else{
00724     fCutList[5] = &Cutter::DummyCutter;
00725   }
00726 
00727   if(fAllKovTrigCut){
00728     fCutList[6] = &Cutter::AllKovTrigCutter;
00729     fBinLabel[7] = "AllKovTrig";
00730   }
00731   else{
00732     fCutList[6] = &Cutter::DummyCutter;
00733   }
00734 
00735   if(fPIDOrTrigCut){
00736     fCutList[7] = &Cutter::PIDOrTrigCutter;
00737     fBinLabel[8] = "PIDTrig";
00738   }
00739   else{
00740     fCutList[7] = &Cutter::DummyCutter;
00741   }
00742 
00743   if(fLITrigCut){
00744     fCutList[8] = &Cutter::LITrigCutter;
00745     fBinLabel[9] = "LITrig";
00746   }
00747   else{
00748     fCutList[8] = &Cutter::DummyCutter;
00749   }
00750 
00751   if(fDCCut){
00752     fCutList[9] = &Cutter::DeadChipCutter;
00753     fBinLabel[10] = "DC";
00754   }
00755   else{
00756     fCutList[9] = &Cutter::DummyCutter;
00757   }
00758 
00759   if(fKovCut){
00760     fCutList[10]=&Cutter::KovCutter;
00761     fBinLabel[11] = "Kov";    
00762   }
00763   else{
00764     fCutList[10] = &Cutter::DummyCutter;
00765   }
00766 
00767   if(fSparseErrCut){
00768     fCutList[11] = &Cutter::SparseErrorCutter;
00769     fBinLabel[12] = "SE";     
00770   }
00771   else{
00772     fCutList[11] = &Cutter::DummyCutter;
00773   }
00774 
00775   if(fFafErrCut){
00776     fCutList[12] = &Cutter::FafErrorCutter;
00777     fBinLabel[13] = "Faf";
00778   }  
00779   else{
00780     fCutList[12] = &Cutter::DummyCutter;
00781   }
00782 
00783   if(fOSCut){
00784     fCutList[13] = &Cutter::OverShootCutter;
00785     fBinLabel[14] = "OS";    
00786   }
00787   else{
00788     fCutList[13] = &Cutter::DummyCutter;
00789   }
00790 
00791   if(fTOFCut){
00792     fCutList[14]=&Cutter::TOFCutter;
00793     fBinLabel[15]="TOF";
00794   }
00795   else{
00796     fCutList[14]=&Cutter::DummyCutter;
00797   }
00798 
00799   if(fCCCut){
00800     fCutList[15]=&Cutter::CosmicCounterCutter;
00801     fBinLabel[16] = "Cos";
00802   }
00803   else{
00804     fCutList[15] = &Cutter::DummyCutter;
00805   }
00806 
00807   if(fTPMTCut){
00808     fCutList[16]=&Cutter::TrigPMTCutter;
00809     fBinLabel[17] = "PMT";
00810   }
00811   else{
00812     fCutList[16] = &Cutter::DummyCutter;
00813   }
00814 
00815   if(fDeadKovCut){    
00816     fCutList[17]=&Cutter::DeadKovCutter;
00817     fBinLabel[18] = "DK";
00818   }
00819   else{
00820     fCutList[17] = &Cutter::DummyCutter;
00821   }
00822 
00823   if(fNDErrorCut){    
00824     fCutList[18]=&Cutter::NDErrorCutter;
00825     fBinLabel[19] = "NDE";
00826   }
00827   else{
00828     fCutList[18] = &Cutter::DummyCutter;
00829   }
00830 
00831   for(int i=0;i<fNCuts+1;i++){
00832     MSG("Cutter",Msg::kInfo)<<"THE CUTS ARE SET AS FOLLOWS:"<<endl
00833                             <<fBinLabel[i]<<endl;
00834   }
00835   
00836   return;
00837 }//end BeginJob

bool Cutter::SparseErrorCutter (  )  const [inline]

Definition at line 173 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetSparseErr().

Referenced by SetCuts().

00174 {
00175   if(fCCDH->GetSparseErr()){ //true if there are sparse errs
00176     return false;
00177   }
00178 
00179   return true; //if we get here, no errors, passes cut
00180 }//end SparseErrorCutter()

bool Cutter::TOFCutter (  )  const [inline]

Definition at line 259 of file Cutter.h.

References fCCDH, CandCalDetSIHandle::GetTofTDC0(), CandCalDetSIHandle::GetTofTDC1(), and CandCalDetSIHandle::GetTofTDC2().

Referenced by SetCuts().

00260 {
00261 
00262   if(fCCDH->GetTofTDC0()>0||fCCDH->GetTofTDC1()>0||fCCDH->GetTofTDC2()>0){
00263     return true;
00264   }
00265 
00266   return false;
00267 
00268 }//end TOFCut

bool Cutter::TOFTrigCutter (  )  const [inline]

Definition at line 272 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00273 {
00274 
00275   if(fCCDH->GetTrigSource()&0x08){
00276     return true;
00277   }
00278 
00279   return false;
00280 }//end TOFTrigCutter()

bool Cutter::TriggerCutter (  )  const [inline]

Definition at line 198 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTrigSource().

Referenced by SetCuts().

00199 {
00200 
00201   // cout<<hex<<fCCDH->GetTrigSource()<<dec<<endl;
00202   if(fCCDH->GetTrigSource()&0x04){ //plane trigger
00203     if((fCCDH->GetTrigSource()>>8)>1){
00204       //cout<<"PASSED TRIGGER CUT"<<endl;
00205       return true; //2/3 plane trigger
00206     }
00207     else{
00208       return false;
00209     }
00210   }
00211   else{ //otherwise it fails
00212     return false;
00213   }
00214 
00215 }//End TriggerCutter()

bool Cutter::TrigPMTCutter (  )  const [inline]

Definition at line 220 of file Cutter.h.

References fCCDH, and CandCalDetSIHandle::GetTriggerPMT().

Referenced by SetCuts().

00221 {
00222   
00223   if(fCCDH->GetTriggerPMT()){ //true if there is a trigger pmt signal
00224     return false;
00225   }
00226 
00227   return true;
00228 
00229 } //end TrigPMTCutter

void Cutter::WriteCutHistogram (  ) 

Definition at line 447 of file Cutter.cxx.

References fCanvas, fCutHistogram, fFileName, fname, Msg::kError, Msg::kInfo, and MSG.

Referenced by HandleCommand().

00448 {
00449 
00450 
00451 //  stringstream fn;
00452 //  fn << "cuts-" << fRunNumber << ".root" << '\0';
00453 //  fn >> fFileName;
00454   const char* fname = fFileName.c_str();
00455   TFile f(fname, "RECREATE");
00456   if(!f.IsOpen()){
00457     MSG("Cutter",Msg::kError) << "Could not open " << fname
00458                               << " for writing Cut Histogram" << endl;
00459     return;
00460   }
00461   MSG("Cutter",Msg::kInfo) <<"Writing cut hists to " << fname<<endl;
00462 
00463 
00464   fCanvas.Update();
00465   f.cd();
00466   fCutHistogram.Write();
00467   fCanvas.Write();
00468   f.Close();
00469 
00470   return;
00471 
00472 
00473 }//end WriteCutHistogram()


Member Data Documentation

bool Cutter::fAllKovTrigCut [private]

Definition at line 135 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

std::string Cutter::fBinLabel[fNCuts+1] [private]

Definition at line 161 of file Cutter.h.

Referenced by Ana(), Cutter(), DrawCutHistogram(), and SetCuts().

TCanvas Cutter::fCanvas [private]

Definition at line 165 of file Cutter.h.

Referenced by Cutter(), DrawCutHistogram(), and WriteCutHistogram().

bool Cutter::fCCCut [private]

Definition at line 125 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

std::set<RawChannelId> Cutter::fChipsToCut [private]

Definition at line 167 of file Cutter.h.

Referenced by DeadChipCutter(), and FillChipsToCut().

int Cutter::fCounter [private]

Definition at line 158 of file Cutter.h.

Referenced by Ana().

TH1F Cutter::fCutHistogram [private]

Definition at line 164 of file Cutter.h.

Referenced by Ana(), Cutter(), DrawCutHistogram(), GetCutHistogram(), and WriteCutHistogram().

Definition at line 166 of file Cutter.h.

Referenced by Ana(), and SetCuts().

bool Cutter::fCutsSet [private]

Definition at line 145 of file Cutter.h.

Referenced by Ana().

bool Cutter::fDCCut [private]

Definition at line 126 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

int Cutter::fDCPlaneCut [private]

Definition at line 154 of file Cutter.h.

Referenced by FillChipsToCut(), GetDCPlaneCut(), HandleCommand(), and SetCuts().

bool Cutter::fDeadKovCut [private]

Definition at line 138 of file Cutter.h.

Referenced by SetCuts().

bool Cutter::fDrawHist [private]

Definition at line 141 of file Cutter.h.

Referenced by Ana(), and HandleCommand().

bool Cutter::fFafErrCut [private]

Definition at line 122 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

std::string Cutter::fFileName [private]

Definition at line 159 of file Cutter.h.

Referenced by Config(), HandleCommand(), and WriteCutHistogram().

bool Cutter::fFilledChipsToCut [private]

Definition at line 168 of file Cutter.h.

Referenced by Get().

int Cutter::fFrequency [private]

Definition at line 157 of file Cutter.h.

Referenced by Ana(), and HandleCommand().

bool Cutter::fKov1TrigCut [private]

Definition at line 131 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fKov2TrigCut [private]

Definition at line 132 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fKov3TrigCut [private]

Definition at line 133 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

int Cutter::fKovADCCutHigh1 [private]

Definition at line 148 of file Cutter.h.

Referenced by HandleCommand(), and KovCutter().

int Cutter::fKovADCCutHigh2 [private]

Definition at line 150 of file Cutter.h.

Referenced by HandleCommand(), and KovCutter().

int Cutter::fKovADCCutHigh3 [private]

Definition at line 152 of file Cutter.h.

Referenced by KovCutter().

int Cutter::fKovADCCutLow1 [private]

Definition at line 147 of file Cutter.h.

Referenced by HandleCommand(), and KovCutter().

int Cutter::fKovADCCutLow2 [private]

Definition at line 149 of file Cutter.h.

Referenced by HandleCommand(), and KovCutter().

int Cutter::fKovADCCutLow3 [private]

Definition at line 151 of file Cutter.h.

Referenced by KovCutter().

bool Cutter::fKovCut [private]

Definition at line 128 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fKovORTrigCut [private]

Definition at line 134 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fLITrigCut [private]

Definition at line 136 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

int Cutter::fMinOST [private]

Definition at line 155 of file Cutter.h.

Referenced by GetMinOST(), HandleCommand(), OverShootCutter(), and SetCuts().

bool Cutter::fNDErrorCut [private]

Definition at line 139 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fOSCut [private]

Definition at line 127 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fPIDOrTrigCut [private]

Definition at line 137 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

RawRecord* Cutter::fRR [private]

Definition at line 162 of file Cutter.h.

Referenced by Ana(), FillChipsToCut(), Get(), NDErrorCutter(), and OverShootCutter().

int Cutter::fRunNumber [private]

Definition at line 160 of file Cutter.h.

Referenced by Ana().

bool Cutter::fSparseErrCut [private]

Definition at line 121 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fTOFCut [private]

Definition at line 129 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fTOFTrigCut [private]

Definition at line 130 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fTPMTCut [private]

Definition at line 124 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fTrigCut [private]

Definition at line 123 of file Cutter.h.

Referenced by HandleCommand(), and SetCuts().

bool Cutter::fWait [private]

Definition at line 143 of file Cutter.h.

Referenced by Ana(), and HandleCommand().

bool Cutter::fWriteHist [private]

Definition at line 142 of file Cutter.h.


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1