PulserFromRawSummaryList Class Reference

#include <PulserFromRawSummaryList.h>

List of all members.

Public Member Functions

 PulserFromRawSummaryList ()
 ~PulserFromRawSummaryList ()
 PulserFromRawSummaryList (const RawDigitDataBlock &, const PulserFromRawLiBlock &)
void Add (const RawDigitDataBlock &, const PulserFromRawLiBlock &)
void Finish ()
VldContext GetVldContext () const
Pulser::EPulseType GetPulseType () const
Int_t GetLed () const
Int_t GetPulserBox () const
Int_t GetHeight () const
Int_t GetWidth () const
Int_t GetNumPulses () const
Int_t GetPointIndex () const
Int_t GetExpectedPoints () const
Int_t GetAggregateNo () const
Int_t GetIdent () const
const PulserSummaryGetHighPin () const
const PulserSummaryGetLowPin () const
std::map< Int_t, PulserSummary >
::const_iterator 
GetBegin () const
std::map< Int_t, PulserSummary >
::const_iterator 
GetEnd () const
std::map< Int_t, PulserSummary >
::const_iterator 
GetNearBegin () const
std::map< Int_t, PulserSummary >
::const_iterator 
GetNearEnd () const
std::map< Int_t, PulserSummary >
::const_iterator 
GetFarBegin () const
std::map< Int_t, PulserSummary >
::const_iterator 
GetFarEnd () const

Private Attributes

std::map< Int_t, PulserSummaryfNearMap
std::map< Int_t, PulserSummaryfFarMap
PulserSummaryfLowPin
PulserSummaryfHighPin
Int_t fTriggers
Pulser::EPulseType fPulseType
Int_t fLed
Int_t fPulserBox
Int_t fWidth
Int_t fHeight
Int_t fNumPulses
Int_t fPointIndex
Int_t fExpectedPoints
Int_t fIdent
PlexLedId fAggregateNo
VldContext fValidity
bool fUsePlex

Detailed Description

Definition at line 31 of file PulserFromRawSummaryList.h.


Constructor & Destructor Documentation

PulserFromRawSummaryList::PulserFromRawSummaryList (  ) 

Definition at line 36 of file PulserFromRawSummaryList.cxx.

References Msg::kVerbose, and MSG.

00036                                                    : 
00037   TNamed("PulserFromRawSummaryList","PulserFromRawSummaryList")
00038 {
00039   MSG("Pulser",Msg::kVerbose) <<" PulserFromRawSummaryList ctor \n";
00040   fLowPin = new PulserSummary();
00041   fHighPin = new PulserSummary();
00042   fTriggers=0;
00043   fUsePlex = false;
00044 }

PulserFromRawSummaryList::~PulserFromRawSummaryList (  ) 

Definition at line 46 of file PulserFromRawSummaryList.cxx.

References fHighPin, fLowPin, Msg::kVerbose, and MSG.

00047 {
00048   MSG("Pulser",Msg::kVerbose) <<" PulserFromRawSummaryList dtor \n";
00049   delete fLowPin;
00050   delete fHighPin;
00051 }

PulserFromRawSummaryList::PulserFromRawSummaryList ( const RawDigitDataBlock rawddb,
const PulserFromRawLiBlock rawsum 
)

Definition at line 54 of file PulserFromRawSummaryList.cxx.

References Add(), fAggregateNo, fExpectedPoints, fHeight, fHighPin, fIdent, fLed, fLowPin, fNumPulses, fPointIndex, fPulserBox, fTriggers, fUsePlex, fValidity, fWidth, PulserFromRawLiBlock::GetCalibPoint(), PulserFromRawLiBlock::GetCalibType(), VldContext::GetDetector(), PulserFromRawLiBlock::GetLed(), PulserFromRawLiBlock::GetPulseHeight(), PulserFromRawLiBlock::GetPulserBox(), PulserFromRawLiBlock::GetPulses(), PulserFromRawLiBlock::GetPulseWidth(), PulserFromRawLiBlock::GetVldContext(), Msg::kVerbose, and MSG.

00055                                                                                  : 
00056   TNamed("PulserFromRawSummaryList","PulserFromRawSummaryList")
00057 {
00058   MSG("Pulser",Msg::kVerbose) <<
00059     " PulserFromRawSummaryList constructing from RawDigitDataBlock \n";
00060   fLowPin = new PulserSummary();
00061   fHighPin = new PulserSummary();
00062   fTriggers=0;
00063   fNumPulses = rawsum.GetPulses();
00064   fLed=rawsum.GetLed();
00065   fPulserBox=rawsum.GetPulserBox();
00066   fHeight=rawsum.GetPulseHeight();
00067   fWidth=rawsum.GetPulseWidth();
00068   fPointIndex=rawsum.GetCalibPoint();
00069   fExpectedPoints=rawsum.GetCalibType(); // Will be 1 for dougpoint, 
00070                                          // more than 1 for gaincurve
00071   fAggregateNo = PlexLedId(rawsum.GetVldContext().GetDetector(),
00072                            fPulserBox, fLed);
00073   fIdent = fLed + 100 * fExpectedPoints;
00074   fUsePlex = false;
00075   fValidity = rawsum.GetVldContext();
00076   this->Add(rawddb,rawsum);
00077 }


Member Function Documentation

void PulserFromRawSummaryList::Add ( const RawDigitDataBlock rawddb,
const PulserFromRawLiBlock rawsum 
)

Definition at line 86 of file PulserFromRawSummaryList.cxx.

References PulserSummary::AddDigit(), PlexStripEndId::BuildPlnStripEndKey(), fAggregateNo, fExpectedPoints, fFarMap, fHeight, fHighPin, fLed, fLowPin, fNearMap, fPointIndex, fPulserBox, fTriggers, fWidth, PulserFromRawLiBlock::GetCalibPoint(), PulserFromRawLiBlock::GetCalibType(), PulserNearDigit::GetChannel(), RawDigitDataBlock::GetDatumIter(), RawChannelId::GetElecType(), RawChannelId::GetEncoded(), PulserFromRawLiBlock::GetLed(), RawDigitDataBlock::GetNumberOfDigits(), PlexStripEndId::GetOppositeSEId(), PulserFromRawLiBlock::GetPulseHeight(), PulserFromRawLiBlock::GetPulserBox(), PulserFromRawLiBlock::GetPulseWidth(), PulserFromRawLiBlock::GetVldContext(), it, Msg::kDebug, ReadoutType::kFlashTrigPMT, ReadoutType::kPinDiode, ElecType::kQIE, ReadoutType::kScintStrip, ElecType::kVA, Msg::kVerbose, and MSG.

Referenced by PulserFromRawSummaryList(), and PulserFromRawModule::Reco().

00088 {
00089   // If we get here, we should be adding the same kinds of pulse
00090   // but just in case...
00091   MSG("Pulser",Msg::kVerbose) <<"LED "<<fLed<<"  "<<rawsum.GetLed()<<endl;
00092   MSG("Pulser",Msg::kVerbose) <<"H   "<<fHeight<<"  "<<rawsum.GetPulseHeight()<<endl;
00093   MSG("Pulser",Msg::kVerbose) <<"W   "<<fWidth<<"  "<<rawsum.GetPulseWidth()<<endl;
00094 
00095   assert(fLed==rawsum.GetLed());
00096   assert(fPulserBox==rawsum.GetPulserBox());
00097   assert(fHeight==rawsum.GetPulseHeight());
00098   assert(fWidth==rawsum.GetPulseWidth());
00099   assert(fPointIndex==rawsum.GetCalibPoint());
00100   assert(fExpectedPoints==rawsum.GetCalibType());
00101 
00102   //Get validity context
00103   VldContext vldc(rawsum.GetVldContext());
00104   PlexHandle plex(vldc);
00105 
00106   int numTriggers=0;
00107   std::pair<PlexPinDiodeId,PlexPinDiodeId> myPins = 
00108      plex.GetPinDiodeIds(fAggregateNo); // hi, low
00109   MSG("Pulser",Msg::kVerbose)<< "We have "
00110                          << rawddb.GetNumberOfDigits() 
00111                          << " digits"<<endl;
00112   TIter rawit = rawddb.GetDatumIter();
00113 
00114   uIntNearMap tempNearMap;
00115   uIntNearMap::iterator tempNearIter;
00116   while (RawDigit *rd = (RawDigit *) rawit()) {
00117      
00118      RawChannelId rcid = rd->GetChannel(); 
00119      ReadoutType::Readout_t rt = plex.GetReadoutType(rcid);
00120      switch (rcid.GetElecType()) {
00121          case (ElecType::kQIE):
00122              if(tempNearMap.find(rcid.GetEncoded())==
00123                 tempNearMap.end()) {
00124                  tempNearMap[rcid.GetEncoded()].New(*rd);
00125              }
00126              else {
00127                  tempNearIter=tempNearMap.find(rcid.GetEncoded());
00128                  tempNearIter->second.Add(*rd);
00129              }
00130              break;
00131          case (ElecType::kVA): 
00132              if (rt & ReadoutType::kScintStrip) {
00133                  MSG("Pulser",Msg::kVerbose) 
00134                      << "Got LI in strip at "<< rcid<<endl;
00135                  
00136                  // Find out which strip-end we are. At CalDet, this is
00137                  // a bit pointless, but...
00138                  PlexSEIdAltL altlist = plex.GetSEIdAltL(rcid);
00139                  for (PlexSEIdAltL::iterator it = altlist.begin(); 
00140                       it!=altlist.end(); it++) {
00141                      PlexStripEndId seid = (*it).GetSEId();
00142                      if (plex.GetLedId(seid) == fAggregateNo) {
00143                          MSG("Pulser",Msg::kVerbose) << "Got LI in strip "
00144                                                    << seid << endl;
00145             
00146                          fNearMap[seid.BuildPlnStripEndKey()].AddDigit(*rd,seid);
00147                      }
00148                      else if (plex.GetLedId(seid.GetOppositeSEId())==
00149                               fAggregateNo) {
00150                          MSG("Pulser",Msg::kVerbose) << "Got LI in strip "
00151                                                    << seid << endl;
00152                          
00153                          fFarMap[seid.BuildPlnStripEndKey()].AddDigit(*rd,seid);
00154                      }
00155                      else {
00156                          // Crosstalk or such
00157                          //     MSG("Pulser",Msg::kVerbose) << "Xtalk "<<rcid<<endl; 
00158                      }
00159                  }
00160              }
00161              else if (rt & ReadoutType::kPinDiode) {
00162                  MSG("Pulser",Msg::kVerbose) << "Got LI in PIN at "
00163                                            << rd->GetChannel()<< endl;
00164                  
00165                  PlexPinDiodeId pinid = plex.GetPinDiodeId(rcid);
00166                  if (pinid==myPins.first) {
00167                      //High gain PIN
00168                      fHighPin->AddDigit(*rd,pinid);
00169                  }
00170                  else if (pinid==myPins.second) {
00171                      //Low Gain PIN
00172                      fLowPin->AddDigit(*rd,pinid);
00173                  }
00174                  // Else not this LED's PIN
00175              }
00176              else if (rt & ReadoutType::kFlashTrigPMT) {
00177                  MSG("Pulser",Msg::kVerbose) 
00178                      << "Got LI in trigger at "<<rd->GetChannel()<<endl;
00179                  numTriggers++;
00180              }
00181              
00182              break;
00183          default:
00184              break;
00185      }
00186      
00187   }
00188   for(tempNearIter = tempNearMap.begin(); 
00189       tempNearIter != tempNearMap.end(); ++tempNearIter) {
00190 
00191       PulserNearDigit nd = tempNearIter->second;
00192       RawChannelId rcid = nd.GetChannel();
00193  
00194       ReadoutType::Readout_t rt2 = plex.GetReadoutType(rcid); 
00195       if (rt2 & ReadoutType::kScintStrip) {
00196           MSG("Pulser",Msg::kVerbose) 
00197               << "Got LI in strip at "<< rcid<<endl;
00198           
00199           // Find out which strip-end we are. At CalDet, this is
00200           // a bit pointless, but...
00201           PlexSEIdAltL altlist = plex.GetSEIdAltL(rcid);
00202           for (PlexSEIdAltL::iterator it = altlist.begin(); 
00203                it!=altlist.end(); it++) {
00204               PlexStripEndId seid = (*it).GetSEId();
00205               if (plex.GetLedId(seid) == fAggregateNo) {
00206                   MSG("Pulser",Msg::kVerbose) << "Got LI in strip "
00207                                             << seid << endl;
00208                   
00209                   fNearMap[seid.BuildPlnStripEndKey()].AddDigit(nd,seid);
00210               }
00211               else if (plex.GetLedId(seid.GetOppositeSEId())==
00212                        fAggregateNo) {
00213                   MSG("Pulser",Msg::kVerbose) << "Got LI in strip "
00214                                             << seid << endl;
00215                   
00216                   fFarMap[seid.BuildPlnStripEndKey()].AddDigit(nd,seid);
00217               }
00218               else {
00219                   // Crosstalk or such
00220                   //    MSG("Pulser",Msg::kVerbose) << "Xtalk "<<rcid<<endl; 
00221               }
00222           }
00223       }
00224      
00225   }
00226   
00227   fTriggers +=numTriggers;
00228   MSG("Pulser",Msg::kDebug) << "Trig PMT: "<<numTriggers<<" of "<<fTriggers<<" triggers\n";
00229   
00230 }

void PulserFromRawSummaryList::Finish (  ) 

Definition at line 232 of file PulserFromRawSummaryList.cxx.

References fFarMap, fHighPin, PulserSummary::Finish(), fLowPin, fNearMap, fTriggers, and it.

Referenced by PulserFromRawModule::FinishList().

00233 {
00234   // Do zero correction here.
00235   for (std::map<Int_t,PulserSummary>::iterator it = fNearMap.begin();
00236        it!=fNearMap.end(); it++) (*it).second.Finish(fTriggers);
00237   for (std::map<Int_t,PulserSummary>::iterator it = fFarMap.begin();
00238        it!=fFarMap.end(); it++) (*it).second.Finish(fTriggers);
00239   fLowPin->Finish(fTriggers);
00240   fHighPin->Finish(fTriggers);
00241 }

Int_t PulserFromRawSummaryList::GetAggregateNo (  )  const [inline]
std::map<Int_t,PulserSummary>::const_iterator PulserFromRawSummaryList::GetBegin (  )  const [inline]

Definition at line 58 of file PulserFromRawSummaryList.h.

References fNearMap.

00058 {return fNearMap.begin();}

std::map<Int_t,PulserSummary>::const_iterator PulserFromRawSummaryList::GetEnd (  )  const [inline]

Definition at line 59 of file PulserFromRawSummaryList.h.

References fNearMap.

00059 {return fNearMap.end();}

Int_t PulserFromRawSummaryList::GetExpectedPoints (  )  const [inline]
std::map<Int_t,PulserSummary>::const_iterator PulserFromRawSummaryList::GetFarBegin (  )  const [inline]
std::map<Int_t,PulserSummary>::const_iterator PulserFromRawSummaryList::GetFarEnd (  )  const [inline]
Int_t PulserFromRawSummaryList::GetHeight (  )  const [inline]

Definition at line 46 of file PulserFromRawSummaryList.h.

References fHeight.

Referenced by PEGainModule::DoMeanSigmaFromRawSums(), and LISummaryModule::GetPulserBlocks().

00046 {return fHeight;}

const PulserSummary& PulserFromRawSummaryList::GetHighPin (  )  const [inline]
Int_t PulserFromRawSummaryList::GetIdent (  )  const [inline]

Definition at line 53 of file PulserFromRawSummaryList.h.

References fIdent.

Referenced by PulserFromRawCollectorModule::Reco().

00053 {return fIdent;} // uid for gaincurve

Int_t PulserFromRawSummaryList::GetLed (  )  const [inline]
const PulserSummary& PulserFromRawSummaryList::GetLowPin (  )  const [inline]
std::map<Int_t,PulserSummary>::const_iterator PulserFromRawSummaryList::GetNearBegin (  )  const [inline]
std::map<Int_t,PulserSummary>::const_iterator PulserFromRawSummaryList::GetNearEnd (  )  const [inline]
Int_t PulserFromRawSummaryList::GetNumPulses (  )  const [inline]

Definition at line 48 of file PulserFromRawSummaryList.h.

References fNumPulses.

Referenced by LISummaryModule::GetPulserBlocks().

00048 {return fNumPulses;}

Int_t PulserFromRawSummaryList::GetPointIndex (  )  const [inline]
Int_t PulserFromRawSummaryList::GetPulserBox (  )  const [inline]
Pulser::EPulseType PulserFromRawSummaryList::GetPulseType (  )  const [inline]

Definition at line 42 of file PulserFromRawSummaryList.h.

References fPulseType.

00042 {return fPulseType;} 

VldContext PulserFromRawSummaryList::GetVldContext (  )  const
Int_t PulserFromRawSummaryList::GetWidth (  )  const [inline]

Definition at line 47 of file PulserFromRawSummaryList.h.

References fWidth.

Referenced by PEGainModule::DoMeanSigmaFromRawSums(), and LISummaryModule::GetPulserBlocks().

00047 {return fWidth;}


Member Data Documentation

Definition at line 85 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetAggregateNo(), and PulserFromRawSummaryList().

Definition at line 83 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetExpectedPoints(), and PulserFromRawSummaryList().

Definition at line 72 of file PulserFromRawSummaryList.h.

Referenced by Add(), Finish(), GetFarBegin(), and GetFarEnd().

Definition at line 80 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetHeight(), and PulserFromRawSummaryList().

Definition at line 84 of file PulserFromRawSummaryList.h.

Referenced by GetIdent(), and PulserFromRawSummaryList().

Definition at line 77 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetLed(), and PulserFromRawSummaryList().

Definition at line 71 of file PulserFromRawSummaryList.h.

Referenced by Add(), Finish(), GetBegin(), GetEnd(), GetNearBegin(), and GetNearEnd().

Definition at line 81 of file PulserFromRawSummaryList.h.

Referenced by GetNumPulses(), and PulserFromRawSummaryList().

Definition at line 82 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetPointIndex(), and PulserFromRawSummaryList().

Definition at line 78 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetPulserBox(), and PulserFromRawSummaryList().

Definition at line 76 of file PulserFromRawSummaryList.h.

Referenced by GetPulseType().

Definition at line 75 of file PulserFromRawSummaryList.h.

Referenced by Add(), Finish(), and PulserFromRawSummaryList().

Definition at line 88 of file PulserFromRawSummaryList.h.

Referenced by PulserFromRawSummaryList().

Definition at line 86 of file PulserFromRawSummaryList.h.

Referenced by GetVldContext(), and PulserFromRawSummaryList().

Definition at line 79 of file PulserFromRawSummaryList.h.

Referenced by Add(), GetWidth(), and PulserFromRawSummaryList().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1