LIPatternFinderFancy Class Reference

#include <LIPatternFinderFancy.h>

Inheritance diagram for LIPatternFinderFancy:
LIPatternFinder

List of all members.

Public Member Functions

 LIPatternFinderFancy ()
 ~LIPatternFinderFancy ()
void DefaultConfig (void)
void Configure (const Registry &registry)
bool IsLightInjectionTrash (CandDigitListHandle *cdlh)

Private Member Functions

void BuildPlexMaps (CandDigitListHandle *cdlh)
const PlexLedIdFindLedIdFromStripEndId (const PlexStripEndId &stripend_id) const

Private Attributes

map< PlexStripEndId, PlexLedIdfStrip2LedMap
double fFractionalChargeThreshold

Detailed Description

Definition at line 42 of file LIPatternFinderFancy.h.


Constructor & Destructor Documentation

LIPatternFinderFancy::LIPatternFinderFancy (  ) 

Definition at line 46 of file LIPatternFinderFancy.cxx.

References Msg::kVerbose, and MSG.

00047 {
00048   MSG("LIPatternFinder", Msg::kVerbose)
00049                                 << "LIPatternFinderFancy ctor" << endl;
00050   DefaultConfig();
00051 }

LIPatternFinderFancy::~LIPatternFinderFancy (  ) 

Definition at line 53 of file LIPatternFinderFancy.cxx.

References Msg::kVerbose, and MSG.

00054 {
00055   MSG("LIPatternFinder", Msg::kVerbose)
00056                                 << "LIPatternFinderFancy dtor" << endl;
00057 }


Member Function Documentation

void LIPatternFinderFancy::BuildPlexMaps ( CandDigitListHandle cdlh  )  [private]

Definition at line 142 of file LIPatternFinderFancy.cxx.

References fStrip2LedMap, DbiResultPtr< T >::GetNumRows(), PlexStripEndToLed::GetPlexLedId(), PlexStripEndToLed::GetPlexStripEndId(), DbiResultPtr< T >::GetRow(), CandHandle::GetVldContext(), Msg::kVerbose, and MSG.

Referenced by IsLightInjectionTrash().

00143 {
00144   MSG("LIPatternFinder", Msg::kVerbose)
00145                       << "LIPatternFinderFancy::BuildPlexMaps" << endl;
00146 
00147   //-- Get VldContext from input data
00148 
00149   const VldContext * vld = cdlh->GetVldContext();
00150 
00151   //-- Use DatabseInterface to extract Plex information from the dbase
00152 
00153   MSG("LIPatternFinder", Msg::kVerbose)
00154           << "Extracting Plex information from the data-base" << endl;
00155 
00156   DbiResultPtr<PlexStripEndToLed>       strip_to_led   (*vld);
00157 
00158   MSG("LIPatternFinder", Msg::kVerbose)
00159        << "STRIP->LED / nrows: " << strip_to_led.GetNumRows() << endl;
00160 
00161   //-- loop over STRIP END -> LED rows
00162   for(unsigned int s2l_irow = 0;
00163                   s2l_irow < strip_to_led.GetNumRows(); s2l_irow++) {
00164 
00165      const PlexStripEndToLed * s2l_row =
00166                                        strip_to_led.GetRow(s2l_irow);
00167 
00168      PlexStripEndId stripend_id = s2l_row->GetPlexStripEndId();
00169      PlexLedId      led_id      = s2l_row->GetPlexLedId();
00170 
00171      fStrip2LedMap.insert(
00172            map<PlexStripEndId, PlexLedId>::value_type(
00173                                               stripend_id, led_id));
00174   }
00175   MSG("LIPatternFinder", Msg::kVerbose)
00176              << "PlexStripEndId -> PlexLedId map filled in" << endl;
00177 }

void LIPatternFinderFancy::Configure ( const Registry registry  )  [virtual]

Implements LIPatternFinder.

Definition at line 64 of file LIPatternFinderFancy.cxx.

References fFractionalChargeThreshold, and Registry::Get().

00065 {
00066   double tmpd;
00067   
00068   if (registry.Get("FractionalChargeThreshold", tmpd))
00069                                      fFractionalChargeThreshold = tmpd;
00070 }  

void LIPatternFinderFancy::DefaultConfig ( void   )  [virtual]

Implements LIPatternFinder.

Definition at line 59 of file LIPatternFinderFancy.cxx.

References fFractionalChargeThreshold.

00060 {
00061   fFractionalChargeThreshold = 0.75;
00062 }  

const PlexLedId * LIPatternFinderFancy::FindLedIdFromStripEndId ( const PlexStripEndId stripend_id  )  const [private]

Definition at line 179 of file LIPatternFinderFancy.cxx.

References fStrip2LedMap, and PlexStripEndId::IsSameStripEnd().

Referenced by IsLightInjectionTrash().

00181 {
00182   map<PlexStripEndId, PlexLedId>::const_iterator strip2led_iter;
00183 
00184   for(strip2led_iter = fStrip2LedMap.begin();
00185              strip2led_iter != fStrip2LedMap.end(); ++strip2led_iter) {
00186 
00187       PlexStripEndId curr_stripend_id = strip2led_iter->first;
00188 
00189       if( curr_stripend_id.IsSameStripEnd(stripend_id) )
00190                                       return &(strip2led_iter->second);
00191   }
00192   return 0;
00193 }

bool LIPatternFinderFancy::IsLightInjectionTrash ( CandDigitListHandle cdlh  )  [virtual]

Implements LIPatternFinder.

Definition at line 72 of file LIPatternFinderFancy.cxx.

References BuildPlexMaps(), digit(), fFractionalChargeThreshold, FindLedIdFromStripEndId(), PlexSEIdAltL::GetCurrentItem(), CandHandle::GetDaughterIterator(), PlexLedId::GetLedInBox(), PlexLedId::GetPulserBox(), PlexSEIdAltLItem::GetSEId(), PlexSEIdAltL::IsValid(), Msg::kDebug, MSG, PlexSEIdAltL::Next(), and PlexSEIdAltL::SetFirst().

00074 {
00075   // Use the database interface, read database tables, save results in
00076   // STL maps for easy lookup
00077   
00078   BuildPlexMaps(cdlh); 
00079 
00080   TH2D * hPulserBoxLed = new TH2D("hPulserBoxLed",
00081         "(pulser box, led) q-weighted distribution", 16,0,16,20,0,20);
00082 
00083   CandDigitHandleItr cdh_iter ( cdlh->GetDaughterIterator() );
00084 
00085   double total_charge = 0;
00086   
00087   while ( CandDigitHandle * digit = cdh_iter.Ptr() ) {
00088 
00089     total_charge += digit->GetCharge();
00090 
00091     const PlexSEIdAltL & seid_altl = digit->GetPlexSEIdAltL();    
00092 
00093     seid_altl.SetFirst();
00094 
00095     while( seid_altl.IsValid() ) {
00096 
00097        const PlexSEIdAltLItem & seid_item = seid_altl.GetCurrentItem();
00098 
00099        PlexStripEndId seid = seid_item.GetSEId();
00100 
00101        const PlexLedId * led_id = FindLedIdFromStripEndId(seid);
00102 
00103        if(led_id) {
00104 
00105           MSG("LIPatternFinder", Msg::kDebug)
00106              << " Pbox: " << led_id->GetPulserBox()
00107              << " LED:  " << led_id->GetLedInBox()
00108              << " Q: "    << digit->GetCharge() << endl;
00109 
00110           hPulserBoxLed->Fill(led_id->GetPulserBox(),
00111                            led_id->GetLedInBox(), digit->GetCharge());           
00112        } // if led-id
00113                 
00114        seid_altl.Next();
00115         
00116     } // loop over SEIdAltL  
00117                        
00118     cdh_iter.Next();
00119     
00120   } //loop over CandDigitList
00121 
00122   bool   is_LI = false;
00123   
00124   double max_bin_content  = hPulserBoxLed -> GetMaximum();
00125 
00126   if(total_charge > 0) {
00127 
00128      double fractional_pulse_height  =
00129                                     max_bin_content  / total_charge;
00130                                 
00131      is_LI = (fractional_pulse_height > fFractionalChargeThreshold);
00132 
00133      MSG("LIPatternFinder", Msg::kDebug)
00134           << " Fractional Pulse Height: " << fractional_pulse_height
00135           << endl;
00136   }  
00137   delete hPulserBoxLed;         
00138                            
00139   return is_LI;
00140 }


Member Data Documentation

Definition at line 62 of file LIPatternFinderFancy.h.

Referenced by Configure(), DefaultConfig(), and IsLightInjectionTrash().

Definition at line 60 of file LIPatternFinderFancy.h.

Referenced by BuildPlexMaps(), and FindLedIdFromStripEndId().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1