00001
00002 #include "AdPlotterAlg.h"
00003
00004 #include "Context/Context.h"
00005 #include "Conventions/Detectors.h"
00006 #include "DataSvc/ICableSvc.h"
00007 #include "DetHelpers/ICoordSysSvc.h"
00008 #include "DetDesc/IGeometryInfo.h"
00009 #include "Event/ReadoutHeader.h"
00010 #include "Event/Readout.h"
00011 #include "Event/ReadoutPmtCrate.h"
00012 #include "Event/ReadoutPmtChannel.h"
00013 #include "Event/SimReadoutHeader.h"
00014 #include "Event/ElecHeader.h"
00015 #include "Event/SimHeader.h"
00016 #include "Event/SimHitHeader.h"
00017 #include "Event/SimHitCollection.h"
00018 #include "Event/GenHeader.h"
00019 #include "HepMC/GenEvent.h"
00020
00021 #include "GaudiKernel/ITHistSvc.h"
00022 #include "GaudiKernel/SystemOfUnits.h"
00023
00024 #include "TH2F.h"
00025 #include "TH1F.h"
00026 #include "TStyle.h"
00027
00028 using namespace std;
00029 using namespace DayaBay;
00030
00031 struct AdSummary {
00032 TimeStamp triggerTime;
00033 double adcSum;
00034 };
00035
00036 class AdExamplePlots {
00037 DayaBay::Detector detector;
00038 MsgStream& log;
00039 bool firstReadout;
00040 TimeStamp lastTriggerTime;
00041 vector<AdSummary> adHistory;
00042 public:
00043
00044
00045
00046 TH2F* genVertexZRho;
00047
00048 TH1F* nPhotoElectrons;
00049
00050 TH1F* hitPmts;
00051 TH1F* dtReadout;
00052 TH1F* dtReadoutShort;
00053 TH1F* adcSpectrum;
00054 TH1F* tdcSpectrum;
00055 TH1F* chargeSum;
00056 TH2F* hitPmtVsChargeSum;
00057
00058
00059 bool findCoincidence;
00060 TH1F* dtNeutronCapture;
00061 TH1F* promptEnergy;
00062 TH1F* delayedEnergy;
00063 TH2F* delayedVsPromptEnergy;
00064
00065 AdExamplePlots(DayaBay::Detector det, MsgStream& msg)
00066 : detector(det),
00067 log(msg),
00068 firstReadout(true),
00069 findCoincidence(false)
00070 { }
00071
00072 StatusCode book(ITHistSvc* hsvc, string filepath) {
00073
00074 gStyle->SetHistLineWidth(2);
00075 gStyle->SetHistLineColor(4);
00076 {
00077 string name = detector.detName() + "_HitPmts";
00078 string title = "Number of Hit Pmts for " + detector.detName();
00079 hitPmts = new TH1F(name.c_str(),title.c_str(),200,0,200);
00080 hitPmts->GetXaxis()->SetTitle("Number of Hit PMTs");
00081 hitPmts->GetYaxis()->SetTitle("Readouts");
00082 name = filepath+"/"+detector.detName()+"/hitPmts";
00083 if (hsvc->regHist(name,hitPmts).isFailure()) {
00084 log << MSG::ERROR << "Could not register " << name << endreq;
00085 delete hitPmts; hitPmts = 0;
00086 return StatusCode::FAILURE;
00087 }
00088 }
00089 {
00090 string name = detector.detName() + "_DtReadout";
00091 string title = "Time between readouts for " + detector.detName();
00092 dtReadout = new TH1F(name.c_str(),title.c_str(),200,0,0.02);
00093 dtReadout->GetXaxis()->SetTitle("#Deltat [s]");
00094 dtReadout->GetYaxis()->SetTitle("Readouts / bin");
00095 name = filepath+"/"+detector.detName()+"/dtReadout";
00096 if (hsvc->regHist(name,dtReadout).isFailure()) {
00097 log << MSG::ERROR << "Could not register " << name << endreq;
00098 delete dtReadout; dtReadout = 0;
00099 return StatusCode::FAILURE;
00100 }
00101 }
00102 {
00103 string name = detector.detName() + "_DtReadoutShort";
00104 string title = "Short time between readouts for " + detector.detName();
00105 dtReadoutShort = new TH1F(name.c_str(),title.c_str(),200,0,100.e-6);
00106 dtReadoutShort->GetXaxis()->SetTitle("#Deltat [s]");
00107 dtReadoutShort->GetYaxis()->SetTitle("Readouts / bin");
00108 name = filepath+"/"+detector.detName()+"/dtReadoutShort";
00109 if (hsvc->regHist(name,dtReadoutShort).isFailure()) {
00110 log << MSG::ERROR << "Could not register " << name << endreq;
00111 delete dtReadoutShort; dtReadoutShort = 0;
00112 return StatusCode::FAILURE;
00113 }
00114 }
00115 {
00116 string name = detector.detName() + "_AdcSpectrum";
00117 string title = "ADC spectrum for all channels in " + detector.detName();
00118 adcSpectrum = new TH1F(name.c_str(),title.c_str(),4096,0,4096);
00119 adcSpectrum->GetXaxis()->SetTitle("ADC value");
00120 adcSpectrum->GetYaxis()->SetTitle("Entries");
00121 name = filepath+"/"+detector.detName()+"/adcSpectrum";
00122 if (hsvc->regHist(name,adcSpectrum).isFailure()) {
00123 log << MSG::ERROR << "Could not register " << name << endreq;
00124 delete adcSpectrum; adcSpectrum = 0;
00125 return StatusCode::FAILURE;
00126 }
00127 }
00128 {
00129 string name = detector.detName() + "_TdcSpectrum";
00130 string title = "TDC spectrum for all channels in " + detector.detName();
00131 tdcSpectrum = new TH1F(name.c_str(),title.c_str(),300,0,300);
00132 tdcSpectrum->GetXaxis()->SetTitle("TDC value");
00133 tdcSpectrum->GetYaxis()->SetTitle("Entries");
00134 name = filepath+"/"+detector.detName()+"/tdcSpectrum";
00135 if (hsvc->regHist(name,tdcSpectrum).isFailure()) {
00136 log << MSG::ERROR << "Could not register " << name << endreq;
00137 delete tdcSpectrum; tdcSpectrum = 0;
00138 return StatusCode::FAILURE;
00139 }
00140 }
00141 {
00142 string name = detector.detName() + "_ChargeSum";
00143 string title = "ADC Charge sum for " + detector.detName();
00144 chargeSum = new TH1F(name.c_str(),title.c_str(),500,0,20000);
00145 chargeSum->GetXaxis()->SetTitle("Sum(ADC - Baseline)");
00146 chargeSum->GetYaxis()->SetTitle("Readouts");
00147 name = filepath+"/"+detector.detName()+"/chargeSum";
00148 if (hsvc->regHist(name,chargeSum).isFailure()) {
00149 log << MSG::ERROR << "Could not register " << name << endreq;
00150 delete chargeSum; chargeSum = 0;
00151 return StatusCode::FAILURE;
00152 }
00153 }
00154 {
00155 string name = detector.detName() + "_HitPmtVsChargeSum";
00156 string title = "Number of Hit PMTs versus the Charge Sum for"
00157 + detector.detName();
00158 hitPmtVsChargeSum = new TH2F(name.c_str(),title.c_str(),
00159 200,0,20000,
00160 200,0,200);
00161 hitPmtVsChargeSum->GetXaxis()->SetTitle("Sum(ADC - Baseline)");
00162 hitPmtVsChargeSum->GetYaxis()->SetTitle("Number of Hit PMTs");
00163 name = filepath+"/"+detector.detName()+"/hitPmtVsChargeSum";
00164 if (hsvc->regHist(name,hitPmtVsChargeSum).isFailure()) {
00165 log << MSG::ERROR << "Could not register " << name << endreq;
00166 delete hitPmtVsChargeSum; hitPmtVsChargeSum = 0;
00167 return StatusCode::FAILURE;
00168 }
00169 }
00170
00171 {
00172 string name = detector.detName() + "_NPhotoElectrons";
00173 string title = "Number of simulated photoelectrons for "
00174 + detector.detName();
00175 nPhotoElectrons = new TH1F(name.c_str(),title.c_str(),1000,0,1000);
00176 nPhotoElectrons->GetXaxis()->SetTitle("Number of Photoelectrons");
00177 nPhotoElectrons->GetYaxis()->SetTitle("Readouts");
00178 name = filepath+"/"+detector.detName()+"/nPhotoElectrons";
00179 if (hsvc->regHist(name,nPhotoElectrons).isFailure()) {
00180 log << MSG::ERROR << "Could not register " << name << endreq;
00181 delete nPhotoElectrons; nPhotoElectrons = 0;
00182 return StatusCode::FAILURE;
00183 }
00184 }
00185
00186 {
00187 string name = detector.detName() + "_GenVertexZRho";
00188 string title = "Position of generated vertices for " + detector.detName();
00189 genVertexZRho = new TH2F(name.c_str(),title.c_str(),
00190 200,0,3,
00191 200,-5,5);
00192 genVertexZRho->GetXaxis()->SetTitle("Particle (#rho / 3 m)^{2}");
00193 genVertexZRho->GetYaxis()->SetTitle("Particle z [m]");
00194 name = filepath+"/"+detector.detName()+"/genVertexZRho";
00195 if (hsvc->regHist(name,genVertexZRho).isFailure()) {
00196 log << MSG::ERROR << "Could not register " << name << endreq;
00197 delete genVertexZRho; genVertexZRho = 0;
00198 return StatusCode::FAILURE;
00199 }
00200 }
00201 if(findCoincidence){
00202
00203 {
00204
00205 string name = detector.detName() + "_DtNeutronCapture";
00206 string title = "IBD Neutron capture spectrum for " + detector.detName();
00207 dtNeutronCapture = new TH1F(name.c_str(),title.c_str(),200,0,100.e-6);
00208 dtNeutronCapture->GetXaxis()->SetTitle("#Deltat [s]");
00209 dtNeutronCapture->GetYaxis()->SetTitle("Readouts");
00210 name = filepath+"/"+detector.detName()+"/dtNeutronCapture";
00211 if (hsvc->regHist(name,dtNeutronCapture).isFailure()) {
00212 log << MSG::ERROR << "Could not register " << name << endreq;
00213 delete dtNeutronCapture; dtNeutronCapture = 0;
00214 return StatusCode::FAILURE;
00215 }
00216 }
00217 {
00218
00219 string name = detector.detName() + "_PromptEnergy";
00220 string title = "IBD Prompt Energy for " + detector.detName();
00221 promptEnergy = new TH1F(name.c_str(),title.c_str(),200,0,12);
00222 promptEnergy->GetXaxis()->SetTitle("Prompt Energy [MeV]");
00223 promptEnergy->GetYaxis()->SetTitle("Readouts");
00224 name = filepath+"/"+detector.detName()+"/promptEnergy";
00225 if (hsvc->regHist(name,promptEnergy).isFailure()) {
00226 log << MSG::ERROR << "Could not register " << name << endreq;
00227 delete promptEnergy; promptEnergy = 0;
00228 return StatusCode::FAILURE;
00229 }
00230 }
00231 {
00232
00233 string name = detector.detName() + "_DelayedEnergy";
00234 string title = "IBD Delayed Energy for " + detector.detName();
00235 delayedEnergy = new TH1F(name.c_str(),title.c_str(),200,0,12);
00236 delayedEnergy->GetXaxis()->SetTitle("Delayed Energy [MeV]");
00237 delayedEnergy->GetYaxis()->SetTitle("Readouts");
00238 name = filepath+"/"+detector.detName()+"/delayedEnergy";
00239 if (hsvc->regHist(name,delayedEnergy).isFailure()) {
00240 log << MSG::ERROR << "Could not register " << name << endreq;
00241 delete delayedEnergy; delayedEnergy = 0;
00242 return StatusCode::FAILURE;
00243 }
00244 }
00245 {
00246
00247 string name = detector.detName() + "_DelayedVsPromptEnergy";
00248 string title = "IBD Delayed vs. Prompt Energy for " + detector.detName();
00249 delayedVsPromptEnergy = new TH2F(name.c_str(),title.c_str(),
00250 200,0,12,
00251 200,0,12);
00252 delayedVsPromptEnergy->GetXaxis()->SetTitle("Prompt Energy [MeV]");
00253 delayedVsPromptEnergy->GetYaxis()->SetTitle("Delayed Energy [MeV]");
00254 name = filepath+"/"+detector.detName()+"/delayedVsPromptEnergy";
00255 if (hsvc->regHist(name,delayedVsPromptEnergy).isFailure()) {
00256 log << MSG::ERROR << "Could not register " << name << endreq;
00257 delete delayedVsPromptEnergy; delayedVsPromptEnergy = 0;
00258 return StatusCode::FAILURE;
00259 }
00260 }
00261 }
00262 return StatusCode::SUCCESS;
00263 }
00264
00265 StatusCode fill(ICableSvc* , const ServiceMode &,
00266 ICoordSysSvc* coord, const ReadoutHeader* roh)
00267 {
00268
00269 const DayaBay::ReadoutPmtCrate* ro =
00270 dynamic_cast<const DayaBay::ReadoutPmtCrate*>(roh->readout());
00271 if (!ro) {
00272 log << MSG::DEBUG << "Got a non-PmtCrate readout, skipping..." << endreq;
00273 return StatusCode::SUCCESS;
00274 }
00275
00276 double adcChargeSum = 0;
00277 int nHitPmts = 0;
00278 const ReadoutPmtCrate::PmtChannelReadouts&
00279 channelMap = ro->channelReadout();
00280 ReadoutPmtCrate::PmtChannelReadouts::const_iterator
00281 it, done = channelMap.end();
00282 for (it=channelMap.begin(); it != done; ++it) {
00283
00284 if(it->first.board() > 12) continue;
00285 nHitPmts++;
00286
00287
00288 double baseline = 500.;
00289 float charge = 0;
00290 const vector<int> &adc = it->second.adc();
00291 vector<int>::const_iterator cit, cdone=adc.end();
00292 for (cit=adc.begin(); cit != cdone; ++cit) {
00293 adcSpectrum->Fill(*cit);
00294 charge += *cit - baseline;
00295 }
00296 adcChargeSum += charge;
00297
00298
00299 const vector<int> &tdc = it->second.tdc();
00300 vector<int>::const_iterator tdcIter, tdcDone = tdc.end();
00301 for (tdcIter=tdc.begin(); tdcIter != tdcDone; ++tdcIter) {
00302 tdcSpectrum->Fill(*tdcIter);
00303 }
00304
00305 }
00306 hitPmts->Fill(nHitPmts);
00307 chargeSum->Fill(adcChargeSum);
00308 hitPmtVsChargeSum->Fill(adcChargeSum, nHitPmts);
00309
00310
00311 if( !firstReadout ){
00312 TimeStamp dt = ro->triggerTime() - lastTriggerTime;
00313 dtReadout->Fill( dt.GetSeconds() );
00314 dtReadoutShort->Fill( dt.GetSeconds() );
00315 }else{
00316 firstReadout = false;
00317 }
00318 lastTriggerTime = ro->triggerTime();
00319
00320
00321 const SimReadoutHeader* simReadoutHeader = 0;
00322 const ElecHeader* elecHeader = 0;
00323 vector<const SimHeader*> simHeaders;
00324 vector<const GenHeader*> genHeaders;
00325 vector<const IHeader*> inputHeaders = roh->inputHeaders();
00326 vector<const IHeader*>::const_iterator headerIter,
00327 headerDone = inputHeaders.end();
00328 log << MSG::INFO << "Processing Input Headers: " << inputHeaders.size()
00329 << endreq;
00330 for (headerIter=inputHeaders.begin(); headerIter != headerDone;
00331 ++headerIter) {
00332 simReadoutHeader = dynamic_cast<const SimReadoutHeader*>(*headerIter);
00333 if(simReadoutHeader){
00334 log << MSG::INFO << " Found SimReadoutHeader" << endreq;
00335 break;
00336 }
00337 }
00338 if(simReadoutHeader){
00339 inputHeaders = simReadoutHeader->inputHeaders();
00340 headerDone = inputHeaders.end();
00341 for (headerIter=inputHeaders.begin(); headerIter != headerDone;
00342 ++headerIter) {
00343 elecHeader = dynamic_cast<const ElecHeader*>(*headerIter);
00344 if(elecHeader){
00345 log << MSG::INFO << " Found ElecHeader" << endreq;
00346 break;
00347 }
00348 }
00349 }
00350 if(elecHeader){
00351 inputHeaders = elecHeader->inputHeaders();
00352 headerDone = inputHeaders.end();
00353 for (headerIter=inputHeaders.begin(); headerIter != headerDone;
00354 ++headerIter) {
00355 const SimHeader* simHeader
00356 = dynamic_cast<const SimHeader*>(*headerIter);
00357 if(simHeader){
00358 log << MSG::INFO << " Found SimHeader" << endreq;
00359 simHeaders.push_back(simHeader);
00360 }
00361 }
00362 }
00363 if(simHeaders.size() > 0){
00364 for(unsigned int simHeaderIdx=0; simHeaderIdx<simHeaders.size();
00365 simHeaderIdx++){
00366 inputHeaders = (simHeaders[simHeaderIdx])->inputHeaders();
00367 headerDone = inputHeaders.end();
00368 for (headerIter=inputHeaders.begin(); headerIter != headerDone;
00369 ++headerIter) {
00370 const GenHeader* genHeader
00371 = dynamic_cast<const GenHeader*>(*headerIter);
00372 if(genHeader){
00373 log << MSG::INFO << " Found GenHeader" << endreq;
00374 genHeaders.push_back(genHeader);
00375 }
00376 }
00377 }
00378 }
00379
00380
00381
00382 for(unsigned int simHeaderIdx=0; simHeaderIdx<simHeaders.size();
00383 simHeaderIdx++){
00384 log << MSG::INFO << " simHeaderIdx = " << simHeaderIdx << endreq;
00385 const SimHeader* simHeader = simHeaders[simHeaderIdx];
00386 const SimHitHeader* shh = simHeader->hits();
00387 if(!shh){
00388 log << MSG::INFO << "Can't find hit header." << endreq;
00389 continue;
00390 }
00391 short int detId = detector.siteDetPackedData();
00392 SimHitHeader::hc_map::const_iterator hcmapIter
00393 = shh->hitCollection().find(detId);
00394 if(hcmapIter == shh->hitCollection().end()){
00395 log << MSG::INFO << "Can't find hit collection for detector "
00396 << detId << endreq;
00397 log << MSG::INFO << "Have hit collections for "
00398 << shh->hitCollection().size() << " detectors: ";
00399 SimHitHeader::hc_map::const_iterator hcmapDone
00400 = shh->hitCollection().end();
00401 for(hcmapIter = shh->hitCollection().begin(); hcmapIter != hcmapDone;
00402 hcmapIter++){
00403 log << MSG::INFO << hcmapIter->first << "\t";
00404 }
00405 continue;
00406 }
00407 const SimHitCollection* hc = hcmapIter->second;
00408 if(!hc) continue;
00409 int nPeHits = 0;
00410 const SimHitCollection::hit_container& hits = hc->collection();
00411 SimHitCollection::hit_container::const_iterator hitIter,
00412 hitEnd = hits.end();
00413 for(hitIter = hits.begin(); hitIter != hitEnd; hitIter++){
00414 const SimHit* hit = *hitIter;
00415 if(!hit) continue;
00416
00417 if(AdPmtSensor(hit->sensDetId()).ring()<1) continue;
00418 nPeHits++;
00419 }
00420 log << MSG::INFO << " Npe = " << nPeHits << endreq;
00421 nPhotoElectrons->Fill(nPeHits);
00422 }
00423
00424 for(unsigned int genHeaderIdx=0; genHeaderIdx<genHeaders.size();
00425 genHeaderIdx++){
00426 const GenHeader* genHeader = genHeaders[genHeaderIdx];
00427 const HepMC::GenEvent* event = genHeader->event();
00428 if(!event) continue;
00429 HepMC::GenEvent::vertex_const_iterator vtxIter,
00430 vtxDone = event->vertices_end();
00431 for(vtxIter = event->vertices_begin(); vtxIter != vtxDone; vtxIter++){
00432 const HepMC::GenVertex* vtx = *vtxIter;
00433 if(!vtx) continue;
00434 double x = vtx->position().x();
00435 double y = vtx->position().y();
00436 double z = vtx->position().z();
00437 log << MSG::INFO << "\n" << vtx->position().t() << endreq;
00438 log << MSG::INFO << " Vertex time: " << vtx->position().t() << endreq;
00439 log << MSG::INFO << "\n" << vtx->position().t() << endreq;
00440 Gaudi::XYZPoint globalPoint(x,y,z);
00441 IDetectorElement* coordDE = coord->coordSysDE(globalPoint);
00442 if(!coordDE){
00443 log << MSG::ERROR << "Failed to find detector element for point: "
00444 << x << "\t" << y << "\t" << z
00445 << endreq;
00446 continue;
00447 }
00448 Gaudi::XYZPoint localPoint = coordDE->geometry()->toLocal(globalPoint);
00449 double rho_3meters = localPoint.Rho()/(3.*Gaudi::Units::meter);
00450 double rhoSq = rho_3meters * rho_3meters;
00451 double z_meters = localPoint.Z()/Gaudi::Units::meter;
00452 genVertexZRho->Fill(rhoSq, z_meters);
00453 if( rhoSq < 0 || rhoSq > 3. || z_meters>5. || z_meters<-5. ){
00454 log << MSG::VERBOSE << "vtx position: " << localPoint.x() << "\t"
00455 << localPoint.y() << "\t" << localPoint.z()
00456 << endreq;
00457 }
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470 }
00471 }
00472
00473 if(findCoincidence){
00474 double dtCut_s = 100.0e-6;
00475 double epCutLow = 0.7;
00476 double epCutHigh = 8.0;
00477 double edCutLow = 6.0;
00478 double edCutHigh = 10.0;
00479 double chargeScale = 14000./8.;
00480 double ed = adcChargeSum / chargeScale;
00481
00482 vector<AdSummary> newHistory;
00483 vector<AdSummary>::iterator histIter, histEnd = adHistory.end();
00484 for(histIter = adHistory.begin(); histIter != histEnd; histIter++){
00485 double dt = ro->triggerTime() - histIter->triggerTime;
00486 if(dt < dtCut_s){
00487 AdSummary promptSummary = *histIter;
00488 newHistory.push_back(promptSummary);
00489 double ep = promptSummary.adcSum / chargeScale;
00490 dtNeutronCapture->Fill(dt);
00491 if( ed > edCutLow && ed < edCutHigh ) promptEnergy->Fill(ep);
00492 if( ep > epCutLow && ep < epCutHigh ) delayedEnergy->Fill(ed);
00493 delayedVsPromptEnergy->Fill(ep,ed);
00494 }
00495 }
00496 AdSummary currentSummary;
00497 currentSummary.triggerTime = ro->triggerTime();
00498 currentSummary.adcSum = adcChargeSum;
00499 newHistory.push_back(currentSummary);
00500 adHistory = newHistory;
00501 }
00502
00503 return StatusCode::SUCCESS;
00504 }
00505
00506 };
00507
00508
00509 AdPlotterAlg::AdPlotterAlg(const std::string& name, ISvcLocator* pSvcLocator)
00510 : GaudiAlgorithm(name,pSvcLocator)
00511 , m_hsvc(0), m_cable(0), m_coord(0)
00512 {
00513 declareProperty("Location",m_location=DayaBay::ReadoutHeaderLocation::Default,
00514 "Location in the TES to ReadoutHeaders");
00515 declareProperty("FilePath",m_filepath="/file1/adplotter/",
00516 "File path of registered histograms.");
00517 declareProperty("FindCoincidence",m_findCoincidence=false,
00518 "Generate coincidence figures");
00519 }
00520
00521 AdPlotterAlg::~AdPlotterAlg()
00522 {
00523 }
00524
00525 StatusCode AdPlotterAlg::initialize()
00526 {
00527 this->GaudiAlgorithm::initialize();
00528
00529
00530 if ( service("THistSvc", m_hsvc).isFailure()) {
00531 error() << " No THistSvc available." << endreq;
00532 return StatusCode::FAILURE;
00533 }
00534
00535 if ( service("StaticCableSvc", m_cable).isFailure()) {
00536 error() << " No CableService available." << endreq;
00537 return StatusCode::FAILURE;
00538 }
00539
00540
00541 if ( service("CoordSysSvc", m_coord).isFailure()) {
00542 error() << " No CoordSysSvc available." << endreq;
00543 return StatusCode::FAILURE;
00544 }
00545
00546 return StatusCode::SUCCESS;
00547 }
00548
00549 StatusCode AdPlotterAlg::execute()
00550 {
00551 DayaBay::ReadoutHeader* roh = get<DayaBay::ReadoutHeader>(m_location);
00552
00553 const Context &ctx = roh->context();
00554 DayaBay::Detector det(ctx.GetSite(),ctx.GetDetId());
00555 AdExamplePlots* plots = m_plots[det];
00556 if (!plots) {
00557 plots = new AdExamplePlots(det,info());
00558 if(m_findCoincidence){
00559 info() << "Adding IBD coincidence figure generation" << endreq;
00560 plots->findCoincidence = m_findCoincidence;
00561 }else{
00562 info() << "Do not add IBD coincidence figure generation" << endreq;
00563 }
00564 m_plots[det] = plots;
00565 plots->book(m_hsvc, m_filepath);
00566 }
00567
00568 return plots->fill(m_cable,ServiceMode(ctx,0),m_coord,roh);
00569 }
00570
00571 StatusCode AdPlotterAlg::finalize()
00572 {
00573 return this->GaudiAlgorithm::finalize();
00574 }
00575