AlgChopListGeneric Class Reference

#include <AlgChopListGeneric.h>

Inheritance diagram for AlgChopListGeneric:
AlgBase

List of all members.

Public Member Functions

 AlgChopListGeneric ()
virtual ~AlgChopListGeneric ()
virtual void RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx)
virtual void Trace (const char *c) const

Detailed Description

Definition at line 16 of file AlgChopListGeneric.h.


Constructor & Destructor Documentation

AlgChopListGeneric::AlgChopListGeneric (  ) 

Definition at line 50 of file AlgChopListGeneric.cxx.

00051 {
00052 }

AlgChopListGeneric::~AlgChopListGeneric (  )  [virtual]

Definition at line 55 of file AlgChopListGeneric.cxx.

00056 {
00057 }


Member Function Documentation

void AlgChopListGeneric::RunAlg ( AlgConfig ac,
CandHandle ch,
CandContext cx 
) [virtual]

Algorithm to chop by using the summed energy waveform of the whole calorimeter.

Implements AlgBase.

Definition at line 62 of file AlgChopListGeneric.cxx.

References digits(), AlgFactory::GetAlgHandle(), CandContext::GetCandRecord(), CandContext::GetDataIn(), AlgFactory::GetInstance(), CandContext::GetMom(), Calibrator::GetTDCFromTime(), RecMinos::GetVldContext(), Calibrator::Instance(), Msg::kError, Detector::kNear, CalTimeType::kNone, kQieRcid, Msg::kWarning, and MSG.

00065 {
00069 
00070   assert(candHandle.InheritsFrom("CandChopListHandle"));
00071   //CandChopListHandle &chopList = dynamic_cast<CandChopListHandle &>(candHandle);
00072 
00073 
00074    assert(candContext.GetDataIn());
00075    // Check for CandDigitListHandle input
00076    if (!(candContext.GetDataIn()->InheritsFrom("CandDigitListHandle"))) {
00077      MSG("Chop",Msg::kWarning ) << "Data into AlgChopListGeneric is not a digit list." << std::endl;
00078    }
00079    
00080    const CandDigitListHandle *cdlh_ptr = 
00081      dynamic_cast<const CandDigitListHandle*>(candContext.GetDataIn());
00082    
00083    const MomNavigator *mom = candContext.GetMom();
00084    const RawDigitDataBlock* rddb = DataUtil::GetRawBlock<RawDigitDataBlock>(mom);
00085    if (!rddb) {
00086      MSG("Chop", Msg::kWarning) << "No RawDigitDataBlock in RawRecord." << endl;
00087      return;
00088    }
00089    
00090    // Get setup for the DigitList maker algorithm
00091    AlgFactory &af = AlgFactory::GetInstance();
00092    AlgHandle ah = af.GetAlgHandle("AlgChop","default");
00093    CandContext cxx(this,candContext.GetMom());
00094 
00095    const VldContext &context = *(candContext.GetCandRecord()->GetVldContext());
00096    if(context.GetDetector() != Detector::kNear) 
00097      MSG("Chop",Msg::kError) << "Running the Generic algorithm on FD data is a no-no!" << endl;
00098 
00099    Calibrator& cal = Calibrator::Instance();
00100    UgliGeomHandle ugli(context);
00101   
00102    // Now do the actual slicing.
00103 
00104    // First, make a nice stl vector of the digits.
00105    DigitVector digits(cdlh_ptr);
00106 
00107    UInt_t ndigits = digits.size();
00108 
00109    // Sort the list by time.
00110    // Not neccessary for this algorithm.
00111    // std::sort(digits.begin(), digits.end(), compareDigitTimes());
00112 
00113    // Also, I want some other pieces of info:
00114    std::vector<int>    digit_tdc(ndigits);
00115    std::vector<UInt_t> digit_plane(ndigits);
00116    //std::vector<float>  digit_tpos(ndigits);
00117    for(UInt_t i=0;i<ndigits;i++) {
00118      digit_tdc[i] = (cal.GetTDCFromTime(digits[i].GetTime(CalTimeType::kNone), kQieRcid));
00119      digit_plane[i] = digits[i].GetPlexSEIdAltL().GetPlane(); 
00120      //if(digit_plane[i]<=PlexPlaneId::LastPlaneNearCalor())
00121      //  digit_tpos[i]  = ugli.GetStripHandle(digits[i].GetPlexSEIdAltL().GetBestSEId()).GetTPos(); 
00122      //else 
00123      //  digit_tpos[i]  = -999;
00124    }
00125 
00126    // Find first and last times. Add some padding so sertain operations are easier to code.
00127    Int_t tfirst = digit_tdc[0];
00128    Int_t tlast  = digit_tdc[0];
00129    for(UInt_t i=0;i<ndigits;i++) {
00130      if(digit_tdc[i] < tfirst) tfirst = digit_tdc[i];
00131      if(digit_tdc[i] > tlast ) tlast  = digit_tdc[i];
00132    }
00133 
00134    // How to make a chop:
00135    //DigitVector slc;
00136    //
00137    //for(UInt_t idig = 0; idig < ndigits; idig++ ) {
00138    //  if digits[idig] should be in chop slc then:
00139    //   slc.push_back(digits[idig]);
00140    //  }
00141    //  cxx.SetDataIn(&(slc));
00142    //  CandDigitListHandle chopHandle = CandDigitList::MakeCandidate(ah,cxx);
00143    // chopHandle.SetName(Form("Chop %d",nchop++));
00144    // chopList.AddDaughterLink(chopHandle);
00145 
00146 }

void AlgChopListGeneric::Trace ( const char *  c  )  const [virtual]

Reimplemented from AlgBase.

Definition at line 149 of file AlgChopListGeneric.cxx.

00150 {
00151 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1