/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Private Member Functions | Private Attributes
McTruthFigRad Class Reference

#include <McTruthFigRad.h>

Collaboration diagram for McTruthFigRad:
Collaboration graph
[legend]

List of all members.

Public Types

enum  RadTypeId_t {
  kUnknown = 0, kU238 = 1, kTh232 = 2, kK40 = 3,
  kCo60 = 4
}

Public Member Functions

 McTruthFigRad (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~McTruthFigRad ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()

Private Member Functions

int processGenHeader (int run, const DayaBay::Detector &detector, const DayaBay::GenHeader *pGenHdr)
int processSimHeader (int run, const DayaBay::Detector &detector, int krad, const DayaBay::SimHeader *pSimHdr)
void FillXY (const DayaBay::Detector &detector, const Gaudi::XYZPoint &point, TH2 *hist)
void FillXZ (const DayaBay::Detector &detector, const Gaudi::XYZPoint &point, TH2 *hist)
void FillYZ (const DayaBay::Detector &detector, const Gaudi::XYZPoint &point, TH2 *hist)
TH1 * getOrMakeHist (int run, const DayaBay::Detector &detector, int krad, int histogram)
std::string getPath (int run, const char *histName, int krad)

Private Attributes

IStatisticsSvcm_statsSvc
ICoordSysSvcm_coordSvc
TimeStampm_firstTriggerTime
std::map< int, TimeStampm_lastTriggerTime
std::map< int, TH1 ** > m_shortCuts
std::vector< TH1 * > m_normalize

Detailed Description

Definition at line 49 of file McTruthFigRad.h.


Member Enumeration Documentation

Enumerator:
kUnknown 
kU238 
kTh232 
kK40 
kCo60 

Definition at line 54 of file McTruthFigRad.h.

                   {
    kUnknown = 0,
    kU238 = 1,
    kTh232 = 2,
    kK40 = 3,
    kCo60 = 4
  };

Constructor & Destructor Documentation

McTruthFigRad::McTruthFigRad ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 29 of file McTruthFigRad.cc.

  : GaudiAlgorithm(name,pSvcLocator),
    m_statsSvc(0),
    m_coordSvc(0),
    m_firstTriggerTime(0)
{
}
McTruthFigRad::~McTruthFigRad ( ) [virtual]

Definition at line 38 of file McTruthFigRad.cc.

{
}

Member Function Documentation

StatusCode McTruthFigRad::initialize ( ) [virtual]

Definition at line 42 of file McTruthFigRad.cc.

{
  // Initialize the necessary services
  StatusCode sc = this->service("StatisticsSvc",m_statsSvc,true);
  if(sc.isFailure()){
    error() << "Failed to get StatisticsSvc" << endreq;
    return sc;
  }

  sc = service("CoordSysSvc", m_coordSvc, true);
  if (sc.isFailure()) {
    error() << "Failed to get CoordSysSvc" << endreq;
    return sc;
  }
  
  return sc;
}
StatusCode McTruthFigRad::execute ( ) [virtual]

Definition at line 60 of file McTruthFigRad.cc.

{
  // Add the current event into histograms
  DayaBay::ReadoutHeader* readoutHeader = 
    get<DayaBay::ReadoutHeader>("/Event/Readout/ReadoutHeader");
  if(!readoutHeader){
    error() << "Failed to get readout header." << endreq;
    return StatusCode::FAILURE;
  }

  const DayaBay::DaqCrate* readout = readoutHeader->daqCrate();
  if(!readout){
    error() << "Failed to get readout from header" << endreq;
    return StatusCode::FAILURE;
  }
  
  int runNumber = readout->runNumber();
  const DayaBay::Detector& detector = readout->detector();
  
  const DayaBay::GenHeader *genHdr = 0;
  const DayaBay::SimHeader *simHdr = 0;

  std::vector<const DayaBay::IHeader*> req_headers;
  std::vector<const DayaBay::IHeader*>::const_iterator header_itr;

  const DayaBay::RegistrationSequence *regseq = get<DayaBay::RegistrationSequence>
    (DayaBay::RegistrationSequence::defaultLocation() );

  const DayaBay::RegistrationSequence::Registrations& reglist = regseq->registrations();
  DayaBay::RegistrationSequence::Registrations::const_iterator regIt, regend = reglist.end();

  for (regIt=reglist.begin(); regIt!=regend; regIt++) {
    const DataObject *objreg = (*regIt).object();
    
    if (objreg->clID() == DayaBay::SimHeader::classID()) {
      simHdr = dynamic_cast<const DayaBay::SimHeader*>(objreg);
    
      int RadType = kUnknown;

      req_headers = simHdr->inputHeaders();
      if (req_headers.size()==0) warning() << "No related genHeaders found." << endreq;

      for (header_itr=req_headers.begin(); header_itr!=req_headers.end(); ++header_itr) {
        genHdr = dynamic_cast<const DayaBay::GenHeader*> (*header_itr);
        
        RadType = processGenHeader(runNumber, detector, genHdr);        
      }
      
      if (RadType>0) processSimHeader(runNumber, detector, RadType, simHdr);
    }   
  }

  return StatusCode::SUCCESS;
}
StatusCode McTruthFigRad::finalize ( ) [virtual]

Definition at line 115 of file McTruthFigRad.cc.

{
  // Handle Normalized histograms
  for(unsigned int normIdx=0; normIdx<m_normalize.size(); normIdx++){
    TH1* hist = m_normalize[normIdx];
    hist->Sumw2();
    if(hist->GetNormFactor()>0){
      double scale = 1./hist->GetNormFactor();
      hist->SetNormFactor(1);
      hist->Scale( scale );
    }
    hist->SetBit(TH1::kIsAverage);
  }
  m_normalize.clear();
  // Clean-up histogram shortcuts
  std::map<int,TH1**>::iterator histIter, histEnd = m_shortCuts.end();
  for(histIter = m_shortCuts.begin(); histIter!=histEnd; histIter++){
    delete [] (histIter->second);
    histIter->second = 0;
  }
  if( m_statsSvc ) m_statsSvc->release();
  if(m_firstTriggerTime){
    delete m_firstTriggerTime;
    m_firstTriggerTime = 0;
  }
  return StatusCode::SUCCESS;
}
int McTruthFigRad::processGenHeader ( int  run,
const DayaBay::Detector detector,
const DayaBay::GenHeader pGenHdr 
) [private]

Definition at line 143 of file McTruthFigRad.cc.

                                                                                                                   {

  debug() << "processing GenHeader" << endreq;

  if (!pGenHdr) {
    warning() << "GenHeader is empty, return" << endreq;
    return -1;
  }

  const std::string generatorName = pGenHdr->generatorName();
  const std::string Unknown = "Unknown";

  const std::string Rad[4] = {"U238", "Th232", "K40", "Co60"};

  int radType = kUnknown;

  for (int i=0; i<4; i++) {
    size_t found = generatorName.find(Rad[i]);
    
    if (found != std::string::npos) {
      radType = i+1;
      debug() << "found " << Rad[i] << " events" << endreq;
    }
  }

  if (radType==kUnknown) return radType;

  TH1F* mcDeltaT = dynamic_cast<TH1F*>(this->getOrMakeHist(runNumber, detector, radType, DELTATRAD));
  TH1F* mcLogDeltaT = dynamic_cast<TH1F*>(this->getOrMakeHist(runNumber, detector, radType, LOGDELTATRAD));

  // Time between triggers      

  if (m_firstTriggerTime) {
    if (m_lastTriggerTime.find(radType) != m_lastTriggerTime.end()) {
      TimeStamp dtTriggerTime = pGenHdr->timeStamp();
      dtTriggerTime.Subtract(m_lastTriggerTime[radType]);
    
      mcDeltaT->Fill(dtTriggerTime.GetSeconds());
      mcLogDeltaT->Fill(TMath::Log10(dtTriggerTime.GetSeconds()));
    }
  }

  if (!m_firstTriggerTime) {
    m_firstTriggerTime =  new TimeStamp(pGenHdr->timeStamp()); 
  }
  
  m_lastTriggerTime[radType] = pGenHdr->timeStamp(); 

  TH2F* mcVtxyVSx = dynamic_cast<TH2F*>(this->getOrMakeHist(runNumber, detector, radType, VTXYVSXRAD));
  TH2F* mcVtxzVSx = dynamic_cast<TH2F*>(this->getOrMakeHist(runNumber, detector, radType, VTXZVSXRAD));
  TH2F* mcVtxzVSy = dynamic_cast<TH2F*>(this->getOrMakeHist(runNumber, detector, radType, VTXZVSYRAD));

  TH1F* mcAllKinE = dynamic_cast<TH1F*>(this->getOrMakeHist(runNumber, detector, radType, AllKINERAD));
  TH1F* mcAlphaKinE = dynamic_cast<TH1F*>(this->getOrMakeHist(runNumber, detector, radType, ALPHAKINERAD));
  TH1F* mcBetaKinE  = dynamic_cast<TH1F*>(this->getOrMakeHist(runNumber, detector, radType, BETAKINERAD));
  TH1F* mcGammaKinE = dynamic_cast<TH1F*>(this->getOrMakeHist(runNumber, detector, radType, GAMMAKINERAD));

  const HepMC::GenEvent* event = pGenHdr->event();
  HepMC::GenEvent::vertex_const_iterator v_it;

  debug() << "total vertices: " << event->vertices_size() << endreq;

  for ( v_it = event->vertices_begin(); v_it!=event->vertices_end(); ++v_it ) {

    debug() << "position: [" 
           << (*v_it)->position().x() << ", "
           << (*v_it)->position().y() << ", "
           << (*v_it)->position().z() << "] "
           << endreq;

    Gaudi::XYZPoint global_point( (*v_it)->position().x(),
                                  (*v_it)->position().y(),
                                  (*v_it)->position().z() );
    
    IDetectorElement *de = m_coordSvc->coordSysDE(global_point, 1);

    if (de) {
      debug() << "detector element: " << de->name() << endreq;
      Gaudi::XYZPoint local_point = de->geometry()->toLocal(global_point);
      
      this->FillXY(detector, local_point, mcVtxyVSx);
      this->FillXZ(detector, local_point, mcVtxzVSx);
      this->FillYZ(detector, local_point, mcVtxzVSy);
    }
        
    HepMC::GenVertex::particles_out_const_iterator pout;
    HepMC::GenVertex::particles_out_const_iterator pout_beg = (*v_it)->particles_out_const_begin();
    HepMC::GenVertex::particles_out_const_iterator pout_end = (*v_it)->particles_out_const_end();
    
    for (pout = pout_beg; pout!=pout_end; ++pout) {

      int pdgid = (*pout)->pdg_id();
      int status = (*pout)->status();
      double kinermatic = (*pout)->momentum().e() - (*pout)->momentum().m();

      if (status==1) {
        mcAllKinE->Fill(kinermatic);
      }
      
      if (pdgid==1000020040 && status==1) { // alpha
        mcAlphaKinE->Fill(kinermatic);
      }

      if (pdgid==11 && status==1) { // beta
        mcBetaKinE->Fill(kinermatic);
      }

      if (pdgid==22 && status==1) { // gamma
        mcGammaKinE->Fill(kinermatic);
      }
      
      debug() << "particle out: "
             << " pid: " << (*pout)->pdg_id()
             << " status: " << (*pout)->status()
             << " energy: " << (*pout)->momentum().e()
             << endreq;
    }
  }
  
  return radType;
}
int McTruthFigRad::processSimHeader ( int  run,
const DayaBay::Detector detector,
int  krad,
const DayaBay::SimHeader pSimHdr 
) [private]

Definition at line 266 of file McTruthFigRad.cc.

                                                                                                                             {
  
  debug() << "processing SimHeader" << endreq;

  if (!pSimHdr) {
    warning() << "SimHeader is empty, return" << endreq;
    return -1;
  }

  TH2F* mcSumhitsVSDepo = dynamic_cast<TH2F*>(this->getOrMakeHist(runNumber, detector, krad, HITSVSDEPORAD));
  TH2F* mcQuenVSDepo = dynamic_cast<TH2F*>(this->getOrMakeHist(runNumber, detector, krad, QUENVSDEPORAD));

  // unobserver statistics

  double EDepInGdLS = 0;
  double EDepInLS = 0;
  double EDepInIAV = 0;
  double EDepInOAV = 0;
  double EDepInOIL = 0;
  
  double QEDepInGdLS = 0;
  double QEDepInLS = 0;
  
  double DepositedEnergyinAD = 0;
  double DepositedEnergyinLS = 0;
  double QuenchedEnergy = 0;
  double SumHitsEnergy = 0;
 
  const DayaBay::SimUnobservableStatisticsHeader* unobservableheader = pSimHdr->unobservableStatistics();

  if (!unobservableheader) {
    warning() << "No SimUnobservableStatisticsHeader" << endreq;
  } else {

    const DayaBay::SimUnobservableStatisticsHeader::stat_map& statmap = unobservableheader->stats();
    DayaBay::SimUnobservableStatisticsHeader::stat_map::const_iterator stIt, stend = statmap.end();
    debug() << " Unobservable Statistics: " << statmap.size() << endreq;

    for (stIt = statmap.begin(); stIt != stend; ++stIt) {
                  
      if (stIt->first == "EDepInGdLS") EDepInGdLS = stIt->second.sum();
      if (stIt->first == "EDepInLS")   EDepInLS = stIt->second.sum();
      if (stIt->first == "EDepInIAV")  EDepInIAV = stIt->second.sum();
      if (stIt->first == "EDepInOAV")  EDepInOAV = stIt->second.sum();
      if (stIt->first == "EDepInOIL")  EDepInOIL = stIt->second.sum();
      
      if (stIt->first == "QEDepInGdLS") QEDepInGdLS = stIt->second.sum();
      if (stIt->first == "QEDepInLS")   QEDepInLS = stIt->second.sum();
    }
  }

  debug() << " EDepInGdLS: " << EDepInGdLS
          << " EDepInLS:   " << EDepInLS
          << " EDepInIAV:  " << EDepInIAV
          << " EDepInOAV:  " << EDepInOAV
          << " EDepInOIL:  " << EDepInOIL
          << " QEDepInGdLS: " << QEDepInGdLS
          << " QEDepInLS: " << QEDepInLS
          << endreq;
  
  DepositedEnergyinAD = EDepInGdLS + EDepInLS + EDepInIAV + EDepInOAV + EDepInOIL;
  DepositedEnergyinLS = EDepInGdLS + EDepInLS;
  QuenchedEnergy = QEDepInGdLS + QEDepInLS;
  
  // sim hit information

  const DayaBay::SimHitHeader* simhitheader = pSimHdr->hits();

  if (!simhitheader) {
    warning() << "No SimHitHeader" << endreq;
    
  } else {

    const DayaBay::SimHitHeader::hc_map& hcmap = simhitheader->hitCollection();
    DayaBay::SimHitHeader::hc_map::const_iterator hc_it, hc_end = hcmap.end();
    debug() << "size of hit collection " << hcmap.size() << endreq;
    
    for (hc_it=hcmap.begin(); hc_it!=hc_end; ++hc_it) { // loop over hit collections

      DayaBay::Detector detector(hc_it->first);

      int sumPE = 0;
     
      const std::vector<DayaBay::SimHit*>& hitvec = hc_it->second->collection();
      std::vector<DayaBay::SimHit*>::const_iterator hvec_it, hvec_end = hitvec.end();
      debug() << detector.detName() << " has " << hitvec.size() << " hits." << endreq;

      if (!detector.isAD()) continue;

      int ring, column = 0;

      for (hvec_it=hitvec.begin(); hvec_it!=hvec_end; ++hvec_it) { 
        
        DayaBay::AdPmtSensor pmtId = DayaBay::AdPmtSensor((*hvec_it)->sensDetId());

        ring = pmtId.ring()-1;
        column = pmtId.column()-1;
        if (ring<0||ring>7||column<0||column>23) continue;

        //double hittime = (*hvec_it)->hitTime();
        sumPE++;
      }
      
      debug() << " totalPE: " << sumPE
              << endreq;

      SumHitsEnergy += sumPE;
    }
  }

  if (DepositedEnergyinAD>0) {
    mcSumhitsVSDepo->Fill(DepositedEnergyinAD, SumHitsEnergy/DepositedEnergyinAD);
  }

  if (DepositedEnergyinLS>0) {
    mcQuenVSDepo->Fill(DepositedEnergyinLS, QuenchedEnergy/DepositedEnergyinLS);
  }

  return 0;
}
void McTruthFigRad::FillXY ( const DayaBay::Detector detector,
const Gaudi::XYZPoint &  point,
TH2 *  hist 
) [private]

Definition at line 616 of file McTruthFigRad.cc.

{
  
  if (detector.site() == Site::kDayaBay || detector.site() == Site::kLingAo) { 
   
    Gaudi::XYZPoint shifted_point( point.X(), 
                                   point.Y() + 3000,
                                   point.Z());
    if (hist)  hist->Fill(shifted_point.X()/Gaudi::Units::m, shifted_point.Y()/Gaudi::Units::m);
  }

  if (detector.site() == Site::kFar) {
    if (hist) hist->Fill(point.X()/Gaudi::Units::m, point.Y()/Gaudi::Units::m);
  }
  
  return;
}
void McTruthFigRad::FillXZ ( const DayaBay::Detector detector,
const Gaudi::XYZPoint &  point,
TH2 *  hist 
) [private]

Definition at line 634 of file McTruthFigRad.cc.

{

  if (detector.site() == Site::kDayaBay || detector.site() == Site::kLingAo) {
    
    Gaudi::XYZPoint shifted_point(point.X(),
                                  point.Y(),
                                  point.Z() + 8000);
    if (hist) hist->Fill(shifted_point.X()/Gaudi::Units::m, shifted_point.Z()/Gaudi::Units::m);
  }

  if (detector.site() == Site::kFar) {
    
    Gaudi::XYZPoint shifted_point;

    if (point.Y()>0) { // shift AD1 & AD2 into upper Z
      shifted_point.SetXYZ(point.X(), 
                           point.Y(),
                           point.Z() + 8000);
    } else {
      shifted_point.SetXYZ(point.X(),
                           point.Y(),
                           point.Z() + 2000);
    }

    if (hist) hist->Fill(shifted_point.X()/Gaudi::Units::m, shifted_point.Z()/Gaudi::Units::m);
  }
  
  return;
}
void McTruthFigRad::FillYZ ( const DayaBay::Detector detector,
const Gaudi::XYZPoint &  point,
TH2 *  hist 
) [private]

Definition at line 665 of file McTruthFigRad.cc.

{
  

  if (detector.site() == Site::kDayaBay || detector.site() == Site::kLingAo) {

    Gaudi::XYZPoint shifted_point;

    if (point.X()<0) {  // AD1
      shifted_point.SetXYZ(point.X(),
                           point.Y() - 3000,
                           point.Z() + 8000);
    } else { // AD2
      shifted_point.SetXYZ(point.X(),
                           point.Y() + 3000,
                           point.Z() + 8000);
    }

    if (hist) hist->Fill(shifted_point.Y()/Gaudi::Units::m, shifted_point.Z()/Gaudi::Units::m);
  }

  if (detector.site() == Site::kFar) {
    
    Gaudi::XYZPoint shifted_point;

    if (point.X()<0 && point.Y()>0) { // AD1
      shifted_point.SetXYZ(point.X(),
                           point.Y(),
                           point.Z() + 8000);
    }

    if (point.X()>0 && point.Y()>0) { // AD2
      shifted_point.SetXYZ(point.X(),
                           point.Y() + 6000,
                           point.Z() + 8000);
    }

    if (point.X()<0 && point.Y()<0) { // AD3
      shifted_point.SetXYZ(point.X(),
                           point.Y() - 6000,
                           point.Z() + 2000);
    }

    if (point.X()>0 && point.Y()<0) { // AD4
      shifted_point.SetXYZ(point.X(),
                           point.Y(),
                           point.Z() + 2000);
    }

    if (hist) hist->Fill(shifted_point.Y()/Gaudi::Units::m, shifted_point.Z()/Gaudi::Units::m);
  }

  return;
}
TH1 * McTruthFigRad::getOrMakeHist ( int  run,
const DayaBay::Detector detector,
int  krad,
int  histogram 
) [private]

Definition at line 389 of file McTruthFigRad.cc.

{
  int siteInt = 0;
  switch(detector.site()){
  case Site::kUnknown:
    siteInt = 0; break;
  case Site::kDayaBay:
    siteInt = 1; break;
  case Site::kLingAo:
    siteInt = 2; break;
  case Site::kFar:
    siteInt = 3; break;
  case Site::kSAB:
    siteInt = 4; break;
  default:
    error() << "Unknown site: " << detector.detName() << endreq;
    return 0;
  }

  int radioInt = krad-1;
  //int detectorInt = int(detector.detectorId());
  std::map<int,TH1**>::iterator histIter = m_shortCuts.find(run);
  TH1** histograms = 0;
  if( histIter == m_shortCuts.end() ){
    // Initialize histogram shortcuts
    histograms = new TH1*[MAXMCTRUTHRADHISTS];
    for(int i=0; i<MAXMCTRUTHRADHISTS; i++) histograms[i] = 0;
    m_shortCuts[run] = histograms;
  }else{
    // Found run
    histograms = histIter->second;
  }
  
  TH1* hist = 
    histograms[siteInt * NRADS * NMCTRUTHRADHISTOGRAMS
               + radioInt * NMCTRUTHRADHISTOGRAMS
               + histogram];
  if(!hist){
    // Make this histogram
    std::string histName;
    if(detector.detectorId()){
      // Make detector histogram
      switch(histogram){

      case VTXYVSXRAD:

        histName = "mc_VtxyVSx_RAD";
        
        if (siteInt!=3) {
          hist = new TH2F(histName.c_str(), "MC-RAD Vertex y .vs. x",
                          120, -6, 6, 60, 0, 6);
          hist->GetXaxis()->SetTitle("x (m)");
          hist->GetYaxis()->SetTitle("y [AD1,AD2: y+3](m)");
          
        } else {
          hist = new TH2F(histName.c_str(), "MC-RAD Vertex y .vs. x",
                          120, -6, 6, 120, -6, 6);
          hist->GetXaxis()->SetTitle("x (m)");
          hist->GetYaxis()->SetTitle("y (m)");
        }
        
        break;

      case VTXZVSXRAD:
        
        histName = "mc_VtxzVSx_RAD";
        if (siteInt!=3) {
          hist = new TH2F(histName.c_str(), "MC-RAD Vertex z .vs. x",
                          120, -6, 6, 70, 0, 7);
          hist->GetXaxis()->SetTitle("x (m)");
          hist->GetYaxis()->SetTitle("z [AD1, AD2: z+8](m)");
        } else {
          hist = new TH2F(histName.c_str(), "MC-RAD Vertex z .vs. x",
                          120, -6, 6, 140, -7, 7);
          hist->GetXaxis()->SetTitle("x (m)");
          hist->GetYaxis()->SetTitle("z [AD1, AD2: z+8; AD3,AD4: z+2](m)");
        }
        break;
        
      case VTXZVSYRAD:

        histName = "mc_VtxzVSy_RAD";

        if (siteInt!=3) {
          hist = new TH2F(histName.c_str(), "MC-RAD Vertex z .vs. y",
                          120, -6, 6, 70, 0, 7);
          hist->GetXaxis()->SetTitle("y [AD1: y-3; AD2: y+3](m)");
          hist->GetYaxis()->SetTitle("z [AD1,AD2: z+8](m)");

        } else {
          hist = new TH2F(histName.c_str(), "MC-RAD Vertex z .vs. y",
                          120, -6, 6, 140, -7, 7);
          hist->GetXaxis()->SetTitle("y [AD2: y+6; AD3: y-6](m)");
          hist->GetYaxis()->SetTitle("z [AD1,AD2: z+8, AD3,AD4: z+2](m)");
        }

        break;

      case DELTATRAD:

        histName = "mc_DeltaT_RAD";
        hist = new TH1F(histName.c_str(),
                        "MC-RAD Time Between Events",
                        100, 0, 0.02);

        hist->GetXaxis()->SetTitle("#Deltat [s]");
        hist->GetYaxis()->SetTitle("Events");
        break;

      case LOGDELTATRAD:

        histName = "mc_LogDeltaT_RAD";
        hist = new TH1F(histName.c_str(),
                        "MC-RAD Time Between Events",
                        100, -10, 0);

        hist->GetXaxis()->SetTitle("log_{10}^{}(#Deltat/1s)");
        hist->GetYaxis()->SetTitle("Events");
        break;

      case AllKINERAD:

        histName = "mc_AllKinE_RAD";
        hist = new TH1F(histName.c_str(),
                        "MC-RAD All Kinetic Energy",
                        5000, 0, 10);
        hist->GetXaxis()->SetTitle("Kinetic Energy (MeV)");
        hist->GetYaxis()->SetTitle("Events");
        break;

      case ALPHAKINERAD:

        histName = "mc_AlphaKinE_RAD";
        hist = new TH1F(histName.c_str(),
                        "MC-RAD #alpha Kinetic Energy",
                        5000, 0, 10);
        hist->GetXaxis()->SetTitle("Kinetic Energy (MeV)");
        hist->GetYaxis()->SetTitle("Events");
        break;

      case BETAKINERAD:

        histName = "mc_BetaKinE_RAD";
        hist = new TH1F(histName.c_str(),
                        "MC-RAD #beta Kinetic Energy",
                        5000, 0, 10);
        hist->GetXaxis()->SetTitle("Kinetic Energy (MeV)");
        hist->GetYaxis()->SetTitle("Events");
        break;

      case GAMMAKINERAD:
      
        histName = "mc_GammaKinE_RAD";
        hist = new TH1F(histName.c_str(),
                        "MC-RAD #gamma Kinetic Energy",
                        5000, 0, 10);
        hist->GetXaxis()->SetTitle("Kinetic Energy (MeV)");
        hist->GetYaxis()->SetTitle("Events");
        break;
       
      case HITSVSDEPORAD:
        
        histName = "mc_simhitsVSdepo_RAD";
        hist = new TH2F(histName.c_str(),
                        "MC-RAD Simhits/Deposit E .vs. Deposit E",
                        100, 0,  15, 
                        100, 0, 300);
        hist->GetXaxis()->SetTitle("Deposited E (MeV)");
        hist->GetYaxis()->SetTitle("SumHits / Deposited E (pe/MeV)");
        break;

      case QUENVSDEPORAD:

        histName = "mc_quenVSdepo_RAD";
        hist = new TH2F(histName.c_str(),
                        "MC Quenched E /Deposit E .vs. Deposited E",
                        100, 0, 15, 
                        100, 0, 1.2);
        hist->GetXaxis()->SetTitle("Deposited E (MeV)");
        hist->GetYaxis()->SetTitle("Quenched E / Deposited E");
        break;
      
      default:
        error() << "Unknown Histogram: " << histogram << endreq;
        return 0;
      }
    }

    debug() << "Making histogram: " << histName << endreq;
    m_statsSvc->put( this->getPath(run, histName.c_str(), krad), 
                     hist );
    histograms[siteInt * NRADS * NMCTRUTHRADHISTOGRAMS
               + radioInt * NMCTRUTHRADHISTOGRAMS
               + histogram] = hist;
  }

  return hist;
}
std::string McTruthFigRad::getPath ( int  run,
const char *  histName,
int  krad 
) [private]

Definition at line 589 of file McTruthFigRad.cc.

{
  // Construct histogram path in statistics service
  std::stringstream path;
  path << "/file1/diagnostics/run_" << std::setfill('0') << std::setw(7) 
       << run
       << "/mctruth";

  std::string dirname;
  
  switch (krad) {
  case kU238:
    dirname = "/source_u238/"; break;
  case kTh232:
    dirname = "/source_th232/"; break;
  case kK40:
    dirname = "/source_k40/"; break;
  case kCo60:
    dirname = "/source_co60/"; break;
  default:
    error() << "Unknown type " << endreq;
  }
  
  path << dirname << histName;
  return path.str();
}

Member Data Documentation

Definition at line 84 of file McTruthFigRad.h.

Definition at line 87 of file McTruthFigRad.h.

Definition at line 90 of file McTruthFigRad.h.

std::map<int, TimeStamp> McTruthFigRad::m_lastTriggerTime [private]

Definition at line 91 of file McTruthFigRad.h.

std::map<int,TH1**> McTruthFigRad::m_shortCuts [private]

Definition at line 92 of file McTruthFigRad.h.

std::vector<TH1*> McTruthFigRad::m_normalize [private]

Definition at line 93 of file McTruthFigRad.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:06:10 for McTruthFigs by doxygen 1.7.4