Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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

Constructor & Destructor Documentation

AlgChopListGeneric::AlgChopListGeneric  ) 
 

Definition at line 49 of file AlgChopListGeneric.cxx.

00050 {
00051 }

AlgChopListGeneric::~AlgChopListGeneric  )  [virtual]
 

Definition at line 54 of file AlgChopListGeneric.cxx.

00055 {
00056 }


Member Function Documentation

void AlgChopListGeneric::RunAlg AlgConfig ac,
CandHandle candHandle,
CandContext candContext
[virtual]
 

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

Implements AlgBase.

Definition at line 61 of file AlgChopListGeneric.cxx.

References digits(), RawRecord::FindRawBlock(), AlgFactory::GetAlgHandle(), CandContext::GetCandRecord(), CandContext::GetDataIn(), VldContext::GetDetector(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), CandContext::GetMom(), Calibrator::GetTDCFromTime(), RecMinos::GetVldContext(), Calibrator::Instance(), kQieRcid, and MSG.

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

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

Reimplemented from AlgBase.

Definition at line 154 of file AlgChopListGeneric.cxx.

00155 {
00156 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 21 22:49:13 2009 for loon by  doxygen 1.3.9.1