Anp::SelectShort Class Reference

#include <SelectShort.h>

Inheritance diagram for Anp::SelectShort:
Anp::AlgSnarl Anp::Base

List of all members.

Public Member Functions

 SelectShort ()
virtual ~SelectShort ()
bool Run (Record &record)
void Config (const Registry &reg)
void End (const DataBlock &)

Private Attributes

double fLowEBoundary
double fHighEBoundary
double fMinNTrackPlane
double fMaxNTrackPlane
double fMaxNEventPlane
double fMinNEventPlane
int fParticleType
int fRoID
int fJmID
int fNtID
double fRoIDPass
double fJmIDPass
double fNtIDPass
double fQoPPass
int fPass
bool fErase
int fNPassed
int fNMissed
int fNTrackPassed
int fNTrackMissed

Detailed Description

Definition at line 14 of file SelectShort.h.


Constructor & Destructor Documentation

Anp::SelectShort::SelectShort (  ) 

Definition at line 27 of file SelectShort.cxx.

00028   :fLowEBoundary(-1),
00029    fHighEBoundary(3),
00030    fMinNTrackPlane(0),
00031    fMaxNTrackPlane(20),
00032    fMaxNEventPlane(-1),
00033    fMinNEventPlane(0),
00034    fParticleType(0),
00035    fRoID(4280),
00036    fJmID(2480),
00037    fNtID(19480),
00038    fRoIDPass(-1),
00039    fJmIDPass(-1),
00040    fNtIDPass(-1),
00041    fQoPPass(0),
00042    fPass(0),
00043    fErase(true),
00044    fNPassed(0),
00045    fNMissed(0),
00046    fNTrackPassed(0),
00047    fNTrackMissed(0)
00048 {
00049 
00050 }

Anp::SelectShort::~SelectShort (  )  [virtual]

Definition at line 53 of file SelectShort.cxx.

00054 {
00055 }


Member Function Documentation

void Anp::SelectShort::Config ( const Registry reg  )  [virtual]

Reimplemented from Anp::AlgSnarl.

Definition at line 147 of file SelectShort.cxx.

References fErase, fHighEBoundary, fJmID, fJmIDPass, fLowEBoundary, fMaxNEventPlane, fMaxNTrackPlane, fMinNEventPlane, fMinNTrackPlane, fNtID, fNtIDPass, fParticleType, fPass, fQoPPass, fRoID, fRoIDPass, Registry::Get(), Registry::KeyExists(), and Anp::Read().

00148 {
00149    //
00150    // Configure self
00151    //
00152 
00153 
00154   //
00155   // Read bool and string variables
00156   //
00157   Anp::Read(reg, "SelectShortErase",    fErase);
00158 
00159   // Configurations
00160   reg.Get( "SelectShortHighEBoundary", fHighEBoundary);
00161   reg.Get( "SelectShortLowEBoundary", fLowEBoundary);
00162   reg.Get( "SelectShortMinNTrackPlane",fMinNTrackPlane);
00163   reg.Get( "SelectShortMaxNTrackPlane",fMaxNTrackPlane);
00164   reg.Get( "SelectShortMaxNEventPlane",fMaxNEventPlane);
00165   reg.Get( "SelectShortMinNEventPlane",fMinNEventPlane);
00166   reg.Get( "SelectShortParticleType", fParticleType);
00167   reg.Get( "SelectShortRoID", fRoID);
00168   reg.Get( "SelectShortJmID", fJmID);
00169   reg.Get( "SelectShortNtID", fNtID);
00170   reg.Get( "SelectShortRoIDPass", fRoIDPass);
00171   reg.Get( "SelectShortJmIDPass", fJmIDPass);
00172   reg.Get( "SelectShortNtIDPass", fNtIDPass);
00173   reg.Get( "SelectShortQoPCut", fQoPPass);
00174   reg.Get( "SelectShortPass", fPass);
00175 
00176   if(reg.KeyExists("PrintConfig"))
00177     {
00178       cout << "SelectShort::Config" << endl
00179                                                    
00180            << "  HighEBoundary    = " <<  fHighEBoundary<< endl
00181            << "  LowEBoundary     = " <<  fLowEBoundary<< endl
00182            << "  MinNTrackPlane   = " <<  fMinNTrackPlane<< endl
00183            << "  MaxNTrackPlane   = " <<  fMaxNTrackPlane<< endl
00184            << "  MaxNEventPlane   = " <<  fMaxNEventPlane<< endl
00185            << "  MinNEventPlane   = " <<  fMinNEventPlane<< endl
00186            << "  ParticleType     = " <<  fParticleType<< endl
00187            << "  RoID             = " <<  fRoID<< endl
00188            << "  JmID             = " <<  fJmID<< endl
00189            << "  NtID             = " <<  fNtID<< endl
00190            << "  RoIDPass         = " <<  fRoIDPass<< endl
00191            << "  JmIDPass         = " <<  fJmIDPass<< endl
00192            << "  NtIDPass         = " <<  fNtIDPass<< endl
00193            << "  QoPCut           = " <<  fQoPPass<< endl
00194            << "  PassKey          = " <<  fPass<< endl
00195            << "  Erase            = " <<  fErase << endl;
00196       
00197     }
00198 }

void Anp::SelectShort::End ( const DataBlock  )  [virtual]

Reimplemented from Anp::AlgSnarl.

Definition at line 201 of file SelectShort.cxx.

References fNMissed, fNPassed, fNTrackMissed, and fNTrackPassed.

00202 {
00203   cout<<"  ------ Select Short------- "<<endl;
00204   cout<<"   Number Passed : "<< fNPassed <<endl;
00205   cout<<"   Number Missed : "<< fNMissed <<endl;
00206   cout<<"   Number Track Passed : "<< fNTrackPassed <<endl;
00207   cout<<"   Number Track Missed : "<< fNTrackMissed <<endl;
00208 
00209 }

bool Anp::SelectShort::Run ( Record record  )  [virtual]

Implements Anp::AlgSnarl.

Definition at line 58 of file SelectShort.cxx.

References Anp::CleanRecord(), Anp::Record::Erase(), Anp::Record::EventBeg(), Anp::Record::EventBegIterator(), Anp::Record::EventEnd(), Anp::Record::EventEndIterator(), fErase, fHighEBoundary, Anp::Record::FindTruth(), fJmID, fJmIDPass, fLowEBoundary, fMaxNEventPlane, fMaxNTrackPlane, fMinNEventPlane, fMinNTrackPlane, fNMissed, fNPassed, fNtID, fNtIDPass, fNTrackMissed, fNTrackPassed, fParticleType, fPass, fQoPPass, fRoID, fRoIDPass, Anp::GetTrack(), Anp::LongestTrack(), Anp::Basic::NPlaneScint(), Anp::Record::TrackBegIterator(), and Anp::Record::TrackEndIterator().

00059 {
00060   //   record.Print();
00061    bool terase=false;
00062    bool eerase=false;
00063    TrackIterator itrack = record.TrackBegIterator(); 
00064    while(itrack != record.TrackEndIterator())
00065      {
00066        terase=false;
00067 
00068        Basic tbase = itrack->GetBasic();
00069        if(     (fMaxNTrackPlane>0) && tbase.NPlaneScint()>fMaxNTrackPlane)    terase=true;
00070        else if((fMinNTrackPlane>0) && tbase.NPlaneScint()<fMinNTrackPlane)    terase=true;
00071        else if((fRoIDPass>0&&fRoID>0))
00072          {
00073            if(fRoIDPass<1 &&(!(itrack->KeyExists(fRoID))||(itrack->DataAt(fRoID)<= fRoIDPass   )))terase=true;
00074            if(fRoIDPass>1 &&((itrack->KeyExists(fRoID))&& (itrack->DataAt(fRoID)> (fRoIDPass-1))))terase=true;
00075          }
00076        else if((fJmIDPass>0&&fJmID>0))
00077          {
00078            if(fJmIDPass<1 &&(!(itrack->KeyExists(fJmID))||(itrack->DataAt(fJmID)<= fJmIDPass    )))terase=true;
00079            if(fJmIDPass>1 &&((itrack->KeyExists(fJmID))&& (itrack->DataAt(fJmID)> (fJmIDPass-1) )))terase=true;
00080          }
00081        else if((fQoPPass<-0.0001 && itrack->QP()>fQoPPass)|| (fQoPPass> 0.0001 && itrack->QP()<fQoPPass))                   terase=true;
00082    
00083        
00084        if(fPass>0){
00085          if(itrack->KeyExists(fPass)) cout<<" The track key  "<<fPass<<" exists with value "<< itrack->DataAt(fPass)<<" "<<terase<<endl;
00086          else itrack->Add(fPass,!(terase));
00087        }
00088        if(terase){
00089          if(fErase)  itrack=record.Erase(itrack);
00090          else itrack++;
00091          fNTrackMissed++;
00092        }
00093        else{
00094          itrack++;
00095          fNTrackPassed++;
00096        }
00097      }
00098 
00099    EventIterator ievent = record.EventBegIterator();
00100 
00101    while(ievent!=record.EventEndIterator()){
00102      const TrackVec tvec = Anp::GetTrack(*ievent, record);
00103 
00104      eerase=false;
00105      TrackIter ltrack = LongestTrack(*ievent, record);
00106 
00107      // If one of the tracks fails then erase the event.
00108      if((int)tvec.size()!=ievent->GetNTracks())  eerase=true;
00109      else if(ltrack!=record.TrackEndIterator() && fPass>0 &&
00110              ((!ltrack->KeyExists(fPass)) ||
00111               ltrack->DataAt(fPass)<=0))   eerase=true;
00112      else if(fHighEBoundary>0 &&
00113              fHighEBoundary<ievent->Gev()) eerase=true;
00114      else if(fLowEBoundary >0 &&
00115              fLowEBoundary >ievent->Gev()) eerase=true;
00116      else if(fMaxNEventPlane>0&&
00117              ievent->GetBasic().NPlaneScint()>fMaxNEventPlane) eerase=true;
00118      else if(fMinNEventPlane>0&&
00119              ievent->GetBasic().NPlaneScint()<fMinNEventPlane) eerase=true;
00120      else if(fParticleType>0&&
00121              !record.FindTruth(*ievent)->IsCC()&&fParticleType==1)eerase=true;
00122      else if((fNtIDPass>0&&fNtID>0)&&
00123              (!(ievent->KeyExists(fNtID))
00124               ||(ievent->DataAt(fNtID)< fNtIDPass)))eerase=true;
00125 
00126      if(fPass>0){       
00127        if(ievent->KeyExists(fPass)) cout<<" The event key  "<<fPass<<" exists with value "<< ievent->DataAt(fPass)<<" "<<eerase<<endl;
00128        else ievent->Add(fPass,!(eerase));
00129      }
00130      if(eerase){
00131       if(fErase)  ievent= record.Erase(ievent);
00132       else  ievent++;
00133       fNMissed++;
00134      }
00135      else{
00136        ievent++;
00137        fNPassed++;
00138      }
00139    }
00140 
00141    if(fErase) Anp::CleanRecord(record.EventBeg(), record.EventEnd(), record);
00142 
00143    return true;
00144 }


Member Data Documentation

bool Anp::SelectShort::fErase [private]

Definition at line 43 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 29 of file SelectShort.h.

Referenced by Config(), and Run().

int Anp::SelectShort::fJmID [private]

Definition at line 36 of file SelectShort.h.

Referenced by Config(), and Run().

double Anp::SelectShort::fJmIDPass [private]

Definition at line 39 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 28 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 32 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 31 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 33 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 30 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 45 of file SelectShort.h.

Referenced by End(), and Run().

Definition at line 44 of file SelectShort.h.

Referenced by End(), and Run().

int Anp::SelectShort::fNtID [private]

Definition at line 37 of file SelectShort.h.

Referenced by Config(), and Run().

double Anp::SelectShort::fNtIDPass [private]

Definition at line 40 of file SelectShort.h.

Referenced by Config(), and Run().

Definition at line 47 of file SelectShort.h.

Referenced by End(), and Run().

Definition at line 46 of file SelectShort.h.

Referenced by End(), and Run().

Definition at line 34 of file SelectShort.h.

Referenced by Config(), and Run().

int Anp::SelectShort::fPass [private]

Definition at line 42 of file SelectShort.h.

Referenced by Config(), and Run().

double Anp::SelectShort::fQoPPass [private]

Definition at line 41 of file SelectShort.h.

Referenced by Config(), and Run().

int Anp::SelectShort::fRoID [private]

Definition at line 35 of file SelectShort.h.

Referenced by Config(), and Run().

double Anp::SelectShort::fRoIDPass [private]

Definition at line 38 of file SelectShort.h.

Referenced by Config(), and Run().


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

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1