00001 #include "PmtCalibLeadingEdge.h"
00002
00003 #include "Event/ReadoutPmtCrate.h"
00004 #include "StatisticsSvc/IStatisticsSvc.h"
00005 #include "DataSvc/ICableSvc.h"
00006 #include "DataSvc/ICalibDataSvc.h"
00007 #include "Context/ServiceMode.h"
00008 #include "TH1F.h"
00009 #include "TF1.h"
00010 #include "TH2.h"
00011 #include "TParameter.h"
00012 #include <math.h>
00013 #include "TGraph.h"
00014
00015 StatusCode PmtCalibLeadingEdge::prepareStats(const Context& context){
00016
00017 DayaBay::Detector detector(context.GetSite(), context.GetDetId());
00018
00019
00020 {
00021 std::string name = "site";
00022 std::ostringstream path;
00023 path << this->getPath(detector) << "/" << name;
00024 TParameter<int>* par = new TParameter<int>(name.c_str(),
00025 context.GetSite());
00026 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00027 error() << "prepareStats(): Could not register " << name
00028 << " at " << path << endreq;
00029 delete par;
00030 par = 0;
00031 return StatusCode::FAILURE;
00032 }
00033 }
00034
00035
00036 {
00037 std::string name = "detectorId";
00038 std::ostringstream path;
00039 path << this->getPath(detector) << "/" << name;
00040 TParameter<int>* par = new TParameter<int>(name.c_str(),
00041 context.GetDetId());
00042 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00043 error() << "prepareStats(): Could not register " << name
00044 << " at " << path << endreq;
00045 delete par;
00046 par = 0;
00047 return StatusCode::FAILURE;
00048 }
00049 }
00050
00051
00052 {
00053 std::string name = "simFlag";
00054 std::ostringstream path;
00055 path << this->getPath(detector) << "/" << name;
00056 TParameter<int>* par = new TParameter<int>(name.c_str(),
00057 context.GetSimFlag());
00058 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00059 error() << "prepareStats(): Could not register " << name
00060 << " at " << path << endreq;
00061 delete par;
00062 par = 0;
00063 return StatusCode::FAILURE;
00064 }
00065 }
00066
00067
00068 {
00069 std::string name = "timeSec";
00070 std::ostringstream path;
00071 path << this->getPath(detector) << "/" << name;
00072 TParameter<int>* par = new TParameter<int>(name.c_str(),
00073 context.GetTimeStamp().GetSec());
00074 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00075 error() << "prepareStats(): Could not register " << name
00076 << " at " << path << endreq;
00077 delete par;
00078 par = 0;
00079 return StatusCode::FAILURE;
00080 }
00081 }
00082
00083
00084 {
00085 std::string name = "timeNanoSec";
00086 std::ostringstream path;
00087 path << this->getPath(detector) << "/" << name;
00088 TParameter<int>* par =
00089 new TParameter<int>(name.c_str(), context.GetTimeStamp().GetNanoSec());
00090 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00091 error() << "prepareStats(): Could not register " << name
00092 << " at " << path << endreq;
00093 delete par;
00094 par = 0;
00095 return StatusCode::FAILURE;
00096 }
00097 }
00098
00099
00100 {
00101 std::string name = "nReadouts";
00102 std::ostringstream path;
00103 path << this->getPath(detector) << "/" << name;
00104 TParameter<int>* par = new TParameter<int>(name.c_str(), 0);
00105 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00106 error() << "prepareStats(): Could not register " << name
00107 << " at " << path << endreq;
00108 delete par;
00109 par = 0;
00110 return StatusCode::FAILURE;
00111 }
00112 }
00113
00115
00116 {
00117 std::ostringstream title, path;
00118 std::string name = "NChannel";
00119 title << "NChannel " << detector.detName();
00120 path << this->getPath(detector) << "/" << name;
00121 TH1F* nchannel = new TH1F(name.c_str(),title.str().c_str(),200,0,200);
00122 nchannel->GetXaxis()->SetTitle("NChannel");
00123 nchannel->GetYaxis()->SetTitle("Entries");
00124 if( m_statsSvc->put(path.str(),nchannel).isFailure() ) {
00125 error() << "prepareStats(): Could not register " << path << endreq;
00126 delete nchannel;
00127 return StatusCode::FAILURE;
00128 }
00129 }
00130
00131 {
00132 std::ostringstream title, path;
00133 std::string name = "adcRawMean";
00134 title << "Raw ADC, mean in " << detector.detName();
00135 path << this->getPath(detector) << "/" << name;
00136 TH1F* adcRawMean = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00137 adcRawMean->GetXaxis()->SetTitle("Ring*24+Column");
00138 adcRawMean->GetYaxis()->SetTitle("Raw ADC mean");
00139 if( m_statsSvc->put(path.str(),adcRawMean).isFailure() ) {
00140 error() << "prepareStats(): Could not register " << path << endreq;
00141 delete adcRawMean;
00142 return StatusCode::FAILURE;
00143 }
00144 }
00145
00146 {
00147 std::ostringstream title, path;
00148 std::string name = "adcRawSigma";
00149 title << "Raw ADC, sigma in " << detector.detName();
00150 path << this->getPath(detector) << "/" << name;
00151 TH1F* adcRawSigma = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00152 adcRawSigma->GetXaxis()->SetTitle("Ring*24+Column");
00153 adcRawSigma->GetYaxis()->SetTitle("Raw ADC sigma");
00154 if( m_statsSvc->put(path.str(),adcRawSigma).isFailure() ) {
00155 error() << "prepareStats(): Could not register " << path << endreq;
00156 delete adcRawSigma;
00157 return StatusCode::FAILURE;
00158 }
00159 }
00160
00161 {
00162 std::ostringstream title, path;
00163 std::string name = "quasiAdcMean";
00164 title << "ADC - preAdc, mean in " << detector.detName();
00165 path << this->getPath(detector) << "/" << name;
00166 TH1F* quasiAdcMean = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00167 quasiAdcMean->GetXaxis()->SetTitle("Ring*24+Column");
00168 quasiAdcMean->GetYaxis()->SetTitle("QuasiAdc mean");
00169 if( m_statsSvc->put(path.str(),quasiAdcMean).isFailure() ) {
00170 error() << "prepareStats(): Could not register " << path << endreq;
00171 delete quasiAdcMean;
00172 return StatusCode::FAILURE;
00173 }
00174 }
00175
00176 {
00177 std::ostringstream title, path;
00178 std::string name = "quasiAdcSigma";
00179 title << "ADC - preAdc, sigma in " << detector.detName();
00180 path << this->getPath(detector) << "/" << name;
00181 TH1F* quasiAdcSigma = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00182 quasiAdcSigma->GetXaxis()->SetTitle("Ring*24+Column");
00183 quasiAdcSigma->GetYaxis()->SetTitle("QuasiAdc sigma");
00184 if( m_statsSvc->put(path.str(),quasiAdcSigma).isFailure() ) {
00185 error() << "prepareStats(): Could not register " << path << endreq;
00186 delete quasiAdcSigma;
00187 return StatusCode::FAILURE;
00188 }
00189 }
00190
00191 {
00192 std::ostringstream title, path;
00193 std::string name = "expAdcMean";
00194 title << "ADC - ave preAdc, mean in " << detector.detName();
00195 path << this->getPath(detector) << "/" << name;
00196 TH1F* expAdcMean = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00197 expAdcMean->GetXaxis()->SetTitle("Ring*24+Column");
00198 expAdcMean->GetYaxis()->SetTitle("ExpAdc mean");
00199 if( m_statsSvc->put(path.str(),expAdcMean).isFailure() ) {
00200 error() << "prepareStats(): Could not register " << path << endreq;
00201 delete expAdcMean;
00202 return StatusCode::FAILURE;
00203 }
00204 }
00205
00206 {
00207 std::ostringstream title, path;
00208 std::string name = "expAdcSigma";
00209 title << "ADC - ave preAdc, sigma in " << detector.detName();
00210 path << this->getPath(detector) << "/" << name;
00211 TH1F* expAdcSigma = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00212 expAdcSigma->GetXaxis()->SetTitle("Ring*24+Column");
00213 expAdcSigma->GetYaxis()->SetTitle("ExpAdc sigma");
00214 if( m_statsSvc->put(path.str(),expAdcSigma).isFailure() ) {
00215 error() << "prepareStats(): Could not register " << path << endreq;
00216 delete expAdcSigma;
00217 return StatusCode::FAILURE;
00218 }
00219 }
00220
00221 {
00222 std::ostringstream title, path;
00223 std::string name = "preAdcMean";
00224 title << "preAdc, mean in " << detector.detName();
00225 path << this->getPath(detector) << "/" << name;
00226 TH1F* preAdcMean = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00227 preAdcMean->GetXaxis()->SetTitle("Ring*24+Column");
00228 preAdcMean->GetYaxis()->SetTitle("preAdc mean");
00229 if( m_statsSvc->put(path.str(),preAdcMean).isFailure() ) {
00230 error() << "prepareStats(): Could not register " << path << endreq;
00231 delete preAdcMean;
00232 return StatusCode::FAILURE;
00233 }
00234 }
00235
00236 {
00237 std::ostringstream title, path;
00238 std::string name = "preAdcSigma";
00239 title << "preAdc, sigma in " << detector.detName();
00240 path << this->getPath(detector) << "/" << name;
00241 TH1F* preAdcSigma = new TH1F(name.c_str(),title.str().c_str(),300,0,300);
00242 preAdcSigma->GetXaxis()->SetTitle("Ring*24+Column");
00243 preAdcSigma->GetYaxis()->SetTitle("preAdc sigma");
00244 if( m_statsSvc->put(path.str(),preAdcSigma).isFailure() ) {
00245 error() << "prepareStats(): Could not register " << path << endreq;
00246 delete preAdcSigma;
00247 return StatusCode::FAILURE;
00248 }
00249 }
00250
00251 {
00252 std::ostringstream title, path;
00253 std::string name = "occupancy";
00254 title << "Occupancy per channel " << detector.detName();
00255 path << this->getPath(detector) << "/" << name;
00256 TH2F* occupancy = new TH2F(name.c_str(),title.str().c_str(),49,0.25,24.75,19,-0.75,8.75);
00257 occupancy->GetXaxis()->SetTitle("Column");
00258 occupancy->GetYaxis()->SetTitle("Ring");
00259 if( m_statsSvc->put(path.str(),occupancy).isFailure() ) {
00260 error() << "prepareStats(): Could not register " << path << endreq;
00261 delete occupancy;
00262 return StatusCode::FAILURE;
00263 }
00264 }
00265
00266 {
00267 std::ostringstream title, path;
00268 std::string name = "gain2D";
00269 title << "Gain per channel " << detector.detName();
00270 path << this->getPath(detector) << "/" << name;
00271 TH2F* gain2D = new TH2F(name.c_str(),title.str().c_str(),49,0.25,24.75,19,-0.75,8.75);
00272 gain2D->GetXaxis()->SetTitle("Column");
00273 gain2D->GetYaxis()->SetTitle("Ring");
00274 if( m_statsSvc->put(path.str(),gain2D).isFailure() ) {
00275 error() << "prepareStats(): Could not register " << path << endreq;
00276 delete gain2D;
00277 return StatusCode::FAILURE;
00278 }
00279 }
00280
00281 {
00282 std::ostringstream title, path;
00283 std::string name = "gain1D";
00284 title << "Gain for all channels " << detector.detName();
00285 path << this->getPath(detector) << "/" << name;
00286 TH1F* gain1D = new TH1F(name.c_str(),title.str().c_str(),50,20,60);
00287 gain1D->GetXaxis()->SetTitle("ADC/PE");
00288 gain1D->GetYaxis()->SetTitle("Number of entries");
00289 if( m_statsSvc->put(path.str(),gain1D).isFailure() ) {
00290 error() << "prepareStats(): Could not register " << path << endreq;
00291 delete gain1D;
00292 return StatusCode::FAILURE;
00293 }
00294 }
00296
00297
00298 {
00299 std::ostringstream title, path;
00300 std::string name = "adcSum";
00301 title << "ADC Sum for readouts in " << detector.detName();
00302 path << this->getPath(detector) << "/" << name;
00303 TH1F* adcSum = new TH1F(name.c_str(),title.str().c_str(),
00304 2000,0,20000);
00305 adcSum->GetXaxis()->SetTitle("ADC Sum value");
00306 adcSum->GetYaxis()->SetTitle("Entries");
00307
00308 info() << "name= " << adcSum->GetName()
00309 << " at path = \"" << path.str() << "\"" << endreq;
00310 if( m_statsSvc->put(path.str(),adcSum).isFailure() ) {
00311 error() << "prepareStats(): Could not register " << path << endreq;
00312 delete adcSum;
00313 return StatusCode::FAILURE;
00314 }
00315 }
00316
00317 {
00318 std::ostringstream title, path;
00319 std::string name = "tdcMean";
00320 title << "Mean TDC for readouts in " << detector.detName();
00321 path << this->getPath(detector) << "/" << name;
00322 TH1F* tdcMean = new TH1F(name.c_str(),title.str().c_str(),
00323 2000,0,2000);
00324 tdcMean->GetXaxis()->SetTitle("TDC value");
00325 tdcMean->GetYaxis()->SetTitle("Entries");
00326 if( m_statsSvc->put(path.str(),tdcMean).isFailure() ) {
00327 error() << "prepareStats(): Could not register " << path << endreq;
00328 delete tdcMean;
00329 return StatusCode::FAILURE;
00330 }
00331 }
00332
00333 {
00334 std::ostringstream title, path;
00335 std::string name = "meanTdcOffset";
00336 title << "Mean TDC offset by ring in " << detector.detName();
00337 path << this->getPath(detector) << "/" << name;
00338 TH1F* meanTdcOffset = new TH1F(name.c_str(),title.str().c_str(),
00339 8,1,9);
00340 meanTdcOffset->GetXaxis()->SetTitle("AD Ring");
00341 meanTdcOffset->GetYaxis()->SetTitle("Mean TDC Offset");
00342 if( m_statsSvc->put(path.str(),meanTdcOffset).isFailure() ) {
00343 error() << "prepareStats(): Could not register " << path << endreq;
00344 delete meanTdcOffset;
00345 return StatusCode::FAILURE;
00346 }
00347 }
00348
00349 {
00350 std::ostringstream title, path;
00351 std::string name = "meanOccupancy";
00352 title << "Mean occupancy by ring in " << detector.detName();
00353 path << this->getPath(detector) << "/" << name;
00354 TH1F* meanOccupancy = new TH1F(name.c_str(),title.str().c_str(),
00355 8,1,9);
00356 meanOccupancy->GetXaxis()->SetTitle("AD Ring");
00357 meanOccupancy->GetYaxis()->SetTitle("Mean Occupancy");
00358 if( m_statsSvc->put(path.str(),meanOccupancy).isFailure() ) {
00359 error() << "prepareStats(): Could not register " << path << endreq;
00360 delete meanOccupancy;
00361 return StatusCode::FAILURE;
00362 }
00363 }
00364
00365
00366 for(int ring = 0; ring <= 8; ring++){
00367
00368 {
00369 std::ostringstream title, path;
00370 std::string name = "occupancy";
00371 title << "Occupancy for PMTs in " << detector.detName()
00372 << " ring " << ring;
00373 path << this->getPath(detector, ring) << "/" << name;
00374 TH1F* occupancy = new TH1F(name.c_str(),title.str().c_str(),
00375 24,1,25);
00376 occupancy->GetXaxis()->SetTitle("Column");
00377 occupancy->GetYaxis()->SetTitle("Occupancy");
00378 if( m_statsSvc->put(path.str(),occupancy).isFailure() ) {
00379 error() << "prepareStats(): Could not register " << path << endreq;
00380 delete occupancy;
00381 return StatusCode::FAILURE;
00382 }
00383 }
00384
00385 {
00386 std::ostringstream title, path;
00387 std::string name = "tdcOffset";
00388 title << "Time Offset for PMTs in " << detector.detName()
00389 << " ring " << ring;
00390 path << this->getPath(detector, ring) << "/" << name;
00391 TH1F* tdcOffset = new TH1F(name.c_str(),title.str().c_str(),
00392 24,1,25);
00393 tdcOffset->GetXaxis()->SetTitle("Column");
00394 tdcOffset->GetYaxis()->SetTitle("Time Offset [tdc]");
00395 if( m_statsSvc->put(path.str(),tdcOffset).isFailure() ) {
00396 error() << "prepareStats(): Could not register " << path << endreq;
00397 delete tdcOffset;
00398 return StatusCode::FAILURE;
00399 }
00400 }
00401
00402 {
00403 std::ostringstream title, path;
00404 std::string name = "adcMean";
00405 title << "ADC Mean for PMTs in " << detector.detName()
00406 << " ring " << ring;
00407 path << this->getPath(detector, ring) << "/" << name;
00408 TH1F* adcMean = new TH1F(name.c_str(),title.str().c_str(),
00409 24,1,25);
00410 adcMean->GetXaxis()->SetTitle("Column");
00411 adcMean->GetYaxis()->SetTitle("Mean ADC");
00412 if( m_statsSvc->put(path.str(),adcMean).isFailure() ) {
00413 error() << "prepareStats(): Could not register " << path << endreq;
00414 delete adcMean;
00415 return StatusCode::FAILURE;
00416 }
00417 }
00418
00419 {
00420 std::ostringstream title, path;
00421 std::string name = "adcSigma";
00422 title << "ADC Sigma for PMTs in " << detector.detName()
00423 << " ring " << ring;
00424 path << this->getPath(detector, ring) << "/" << name;
00425 TH1F* adcSigma = new TH1F(name.c_str(),title.str().c_str(),
00426 24,1,25);
00427 adcSigma->GetXaxis()->SetTitle("Column");
00428 adcSigma->GetYaxis()->SetTitle("ADC Sigma");
00429 if( m_statsSvc->put(path.str(),adcSigma).isFailure() ) {
00430 error() << "prepareStats(): Could not register " << path << endreq;
00431 delete adcSigma;
00432 return StatusCode::FAILURE;
00433 }
00434 }
00435 }
00436
00437 ServiceMode svcMode(context, 0);
00438
00439
00440 const std::vector<DayaBay::FeeChannelId>& channelList
00441 = m_cableSvc->feeChannelIds( svcMode );
00442 std::vector<DayaBay::FeeChannelId>::const_iterator chanIter,
00443 chanEnd = channelList.end();
00444
00445 for(chanIter = channelList.begin(); chanIter != chanEnd; chanIter++){
00446 DayaBay::FeeChannelId chanId = *chanIter;
00447
00448
00449 {
00450 std::string name = "board";
00451 std::ostringstream path;
00452 path << this->getPath(chanId) << "/" << name;
00453 TParameter<int>* par = new TParameter<int>(name.c_str(), chanId.board());
00454 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00455 error() << "prepareStats(): Could not register " << name
00456 << " at " << path << endreq;
00457 delete par;
00458 par = 0;
00459 return StatusCode::FAILURE;
00460 }
00461 }
00462
00463
00464 {
00465 std::string name = "connector";
00466 std::ostringstream path;
00467 path << this->getPath(chanId) << "/" << name;
00468 TParameter<int>* par = new TParameter<int>(name.c_str(),
00469 chanId.connector());
00470 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00471 error() << "prepareStats(): Could not register " << name
00472 << " at " << path << endreq;
00473 delete par;
00474 par = 0;
00475 return StatusCode::FAILURE;
00476 }
00477 }
00478
00479
00480 {
00481 std::string name = "nHits";
00482 std::ostringstream path;
00483 path << this->getPath(chanId) << "/" << name;
00484 TParameter<int>* par = new TParameter<int>(name.c_str(), 0);
00485 if( m_statsSvc->put(path.str(),par).isFailure() ) {
00486 error() << "prepareStats(): Could not register " << name
00487 << " at " << path << endreq;
00488 delete par;
00489 par = 0;
00490 return StatusCode::FAILURE;
00491 }
00492 }
00493
00494
00495 {
00496 std::string name = "tdcRaw";
00497 std::ostringstream title, path;
00498 title << "Raw TDC values for " << detector.detName()
00499 << " channel " << chanId.board() << "_"
00500 << chanId.connector();
00501 path << this->getPath(chanId) << "/" << name;
00502 TH1F* tdcRaw = new TH1F(name.c_str(),title.str().c_str(),
00503 2000,0,2000);
00504 tdcRaw->GetXaxis()->SetTitle("TDC value");
00505 tdcRaw->GetYaxis()->SetTitle("Entries");
00506 if( m_statsSvc->put(path.str(),tdcRaw).isFailure() ) {
00507 error() << "prepareStats(): Could not register " << path << endreq;
00508 delete tdcRaw;
00509 return StatusCode::FAILURE;
00510 }
00511 }
00512
00513
00514 {
00515 std::string name = "tdcByMean";
00516 std::ostringstream title, path;
00517 title << "Mean-corrected TDC values for " << detector.detName()
00518 << " channel " << chanId.board() << "_"
00519 << chanId.connector();
00520 path << this->getPath(chanId) << "/" << name;
00521 TH1F* tdcByMean = new TH1F(name.c_str(),title.str().c_str(),
00522 600,-300,300);
00523 tdcByMean->GetXaxis()->SetTitle("TDC value");
00524 tdcByMean->GetYaxis()->SetTitle("Entries");
00525 if( m_statsSvc->put(path.str(),tdcByMean).isFailure() ) {
00526 error() << "prepareStats(): Could not register " << path << endreq;
00527 delete tdcByMean;
00528 return StatusCode::FAILURE;
00529 }
00530 }
00531
00532
00533 {
00534 std::ostringstream title, path;
00535 std::string name = "adcRaw";
00536 title << "ADC values for " << detector.detName()
00537 << " channel " << chanId.board() << "_"
00538 << chanId.connector();
00539 path << this->getPath(chanId) << "/" << name;
00540 TH1F* adcRaw = new TH1F(name.c_str(),title.str().c_str(),
00541 4096,0,4096);
00542 adcRaw->GetXaxis()->SetTitle("ADC value");
00543 adcRaw->GetYaxis()->SetTitle("Entries");
00544 if( m_statsSvc->put(path.str(),adcRaw).isFailure() ) {
00545 error() << "prepareStats(): Could not register " << path << endreq;
00546 delete adcRaw;
00547 return StatusCode::FAILURE;
00548 }
00549 }
00550
00551
00552 {
00553 std::ostringstream title, path;
00554 std::string name = "quasiAdc";
00555 title << "ADC - preAdc " << detector.detName()
00556 << " channel " << chanId.board() << "_"
00557 << chanId.connector();
00558 path << this->getPath(chanId) << "/" << name;
00559 TH1F* quasiAdc = new TH1F(name.c_str(),title.str().c_str(),
00560 1200,-200,1000);
00561 quasiAdc->GetXaxis()->SetTitle("QuasiADC value");
00562 quasiAdc->GetYaxis()->SetTitle("Entries");
00563 if( m_statsSvc->put(path.str(),quasiAdc).isFailure() ) {
00564 error() << "prepareStats(): Could not register " << path << endreq;
00565 delete quasiAdc;
00566 return StatusCode::FAILURE;
00567 }
00568 }
00569
00570
00571 {
00572 std::ostringstream title, path;
00573 std::string name = "adc";
00574 title << "ADC - Average preAdc " << detector.detName()
00575 << " channel " << chanId.board() << "_"
00576 << chanId.connector();
00577 path << this->getPath(chanId) << "/" << name;
00578 TH1F* adc = new TH1F(name.c_str(),title.str().c_str(),
00579 1200,-200,1000);
00580 adc->GetXaxis()->SetTitle("ADC value");
00581 adc->GetYaxis()->SetTitle("Entries");
00582 if( m_statsSvc->put(path.str(),adc).isFailure() ) {
00583 error() << "prepareStats(): Could not register " << path << endreq;
00584 delete adc;
00585 return StatusCode::FAILURE;
00586 }
00587 }
00588
00589
00590 {
00591 std::ostringstream title, path;
00592 std::string name = "preAdc";
00593 title << "PreADC values for " << detector.detName()
00594 << " channel " << chanId.board() << "_"
00595 << chanId.connector();
00596 path << this->getPath(chanId) << "/" << name;
00597 TH1F* preAdc = new TH1F(name.c_str(),title.str().c_str(),
00598 1200,-200,1000);
00599 preAdc->GetXaxis()->SetTitle("PreADC value");
00600 preAdc->GetYaxis()->SetTitle("Entries");
00601 if( m_statsSvc->put(path.str(),preAdc).isFailure() ) {
00602 error() << "prepareStats(): Could not register " << path << endreq;
00603 delete preAdc;
00604 return StatusCode::FAILURE;
00605 }
00606 }
00607
00608
00609 {
00610 std::ostringstream title, path;
00611 std::string name = "adcByClock";
00612 title << "ADC values by clock cycle for " << detector.detName()
00613 << " channel " << chanId.board() << "_"
00614 << chanId.connector();
00615 path << this->getPath(chanId) << "/" << name;
00616 TH1F* adcByClock = new TH1F(name.c_str(),title.str().c_str(),
00617 20,0,20);
00618 adcByClock->GetXaxis()->SetTitle("ADC Clock Cycle");
00619 adcByClock->GetYaxis()->SetTitle("ADC");
00620 if( m_statsSvc->put(path.str(),adcByClock).isFailure() ) {
00621 error() << "prepareStats(): Could not register " << path << endreq;
00622 delete adcByClock;
00623 return StatusCode::FAILURE;
00624 }
00625 }
00626 }
00627
00628 m_processedDetectors.push_back(detector);
00629
00630 return StatusCode::SUCCESS;
00631 }
00632