1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ////////////////////////////////////////////////////////////
19 // Author: Henrik Tydesjo //
20 // This class is used in the detector algorithm framework //
21 // to process the data stored in special container files //
22 // (see AliITSOnlineSPDscan). For instance, minimum //
23 // threshold values can be calculated. //
24 ////////////////////////////////////////////////////////////
26 #include "AliITSOnlineSPDscanAnalyzer.h"
27 #include "AliITSOnlineSPDscan.h"
28 #include "AliITSOnlineSPDscanSingle.h"
29 #include "AliITSOnlineSPDscanMultiple.h"
30 #include "AliITSOnlineSPDscanMeanTh.h"
31 #include "AliITSOnlineCalibrationSPDhandler.h"
32 #include "AliITSRawStreamSPD.h"
39 Double_t itsSpdErrorf(Double_t *x, Double_t *par){
40 if (par[2]<0) par[2]=0;
41 Double_t val = par[2]+(0.12*256*32-par[2])*(0.5+0.5*TMath::Erf((x[0]-par[0])/par[1]/sqrt(2.)));
44 //Double_t itsSpdErrorfOrig(Double_t *x, Double_t *par){
45 // return 0.5+0.5*TMath::Erf((x[0]-par[0])/par[1]/sqrt(2.));
49 AliITSOnlineSPDscanAnalyzer::AliITSOnlineSPDscanAnalyzer(Char_t *fileName) :
50 fType(99),fDacId(99),fScanObj(NULL),fTriggers(NULL),
51 fOverWrite(kFALSE),fNoiseThreshold(0.01),fNoiseMinimumEvents(100),
52 fMinNrStepsBeforeIncrease(5),fMinIncreaseFromBaseLine(2),fStepDownDacSafe(2),fMaxBaseLineLevel(10)
55 sprintf(fFileName,"%s",fileName);
56 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
57 for (UInt_t hs=0; hs<6; hs++) {
58 fMeanMultiplicity[hs][chipNr]=NULL;
59 fHitEventEfficiency[hs][chipNr]=NULL;
62 for (Int_t module=0; module<240; module++) {
63 fHandler[module]=NULL;
69 AliITSOnlineSPDscanAnalyzer::AliITSOnlineSPDscanAnalyzer(const AliITSOnlineSPDscanAnalyzer& handle) :
70 fType(99),fDacId(99),fScanObj(NULL),fTriggers(NULL),
71 fOverWrite(kFALSE),fNoiseThreshold(0.01),fNoiseMinimumEvents(100),
72 fMinNrStepsBeforeIncrease(5),fMinIncreaseFromBaseLine(2),fStepDownDacSafe(2),fMaxBaseLineLevel(10)
74 // copy constructor, only copies the filename (not the processed data)
75 sprintf(fFileName,"%s",handle.fFileName);
80 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
81 for (UInt_t hs=0; hs<6; hs++) {
82 fMeanMultiplicity[hs][chipNr]=NULL;
83 fHitEventEfficiency[hs][chipNr]=NULL;
87 for (Int_t module=0; module<240; module++) {
88 fHandler[module]=NULL;
94 AliITSOnlineSPDscanAnalyzer::~AliITSOnlineSPDscanAnalyzer() {
96 for (UInt_t hs=0; hs<6; hs++) {
97 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
98 if (fMeanMultiplicity[hs][chipNr]!=NULL) {
99 delete fMeanMultiplicity[hs][chipNr];
101 if (fHitEventEfficiency[hs][chipNr]!=NULL) {
102 delete fHitEventEfficiency[hs][chipNr];
106 if (fTriggers!=NULL) delete fTriggers;
107 if (fScanObj!=NULL) delete fScanObj;
108 for (Int_t module=0; module<240; module++) {
109 if (fHandler[module]!=NULL) {
110 delete fHandler[module];
115 AliITSOnlineSPDscanAnalyzer& AliITSOnlineSPDscanAnalyzer::operator=(const AliITSOnlineSPDscanAnalyzer& handle) {
116 // assignment operator, only copies the filename (not the processed data)
118 for (UInt_t hs=0; hs<6; hs++) {
119 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
120 if (fMeanMultiplicity[hs][chipNr]!=NULL) {
121 delete fMeanMultiplicity[hs][chipNr];
123 if (fHitEventEfficiency[hs][chipNr]!=NULL) {
124 delete fHitEventEfficiency[hs][chipNr];
128 if (fTriggers!=NULL) delete fTriggers;
129 if (fScanObj!=NULL) delete fScanObj;
130 for (Int_t module=0; module<240; module++) {
131 if (fHandler[module]!=NULL) {
132 delete fHandler[module];
136 sprintf(fFileName,"%s",handle.fFileName);
141 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
142 for (UInt_t hs=0; hs<6; hs++) {
143 fMeanMultiplicity[hs][chipNr]=NULL;
144 fHitEventEfficiency[hs][chipNr]=NULL;
148 for (Int_t module=0; module<240; module++) {
149 fHandler[module]=NULL;
157 void AliITSOnlineSPDscanAnalyzer::Init() {
158 // first checks type of container and then initializes container obj
159 FILE* fp0 = fopen(fFileName, "r");
166 fScanObj = new AliITSOnlineSPDscan(fFileName);
167 fType = fScanObj->GetType();
174 fScanObj = new AliITSOnlineSPDscanSingle(fFileName);
179 fScanObj = new AliITSOnlineSPDscanMultiple(fFileName);
180 fDacId = ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacId();
183 fScanObj = new AliITSOnlineSPDscanMeanTh(fFileName);
184 fDacId = ((AliITSOnlineSPDscanMeanTh*)fScanObj)->GetDacId();
187 printf("Type %d not defined!\n",fType);
193 // set some default values (these should later be read from text file)
195 fNoiseThreshold=0.01;
196 fNoiseMinimumEvents=100;
197 fMinNrStepsBeforeIncrease=6;
198 fMinIncreaseFromBaseLine=2;
200 fMaxBaseLineLevel=10;
205 Bool_t AliITSOnlineSPDscanAnalyzer::ProcessDeadPixels(Char_t *oldcalibDir) {
206 // process dead pixel data
207 if (fScanObj==NULL) {
208 printf("No data!\n");
211 // should be type kUNIMA
213 printf("Dead pixels only for scan type %d\n",kUNIMA);
218 for (Int_t i=0; i<240; i++) {
221 UInt_t routerNr = fScanObj->GetRouterNr();
222 UInt_t rowStart = fScanObj->GetRowStart();
223 UInt_t rowEnd = fScanObj->GetRowEnd();
224 for (UInt_t hs=0; hs<6; hs++) {
225 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
226 if (fScanObj->GetChipPresent(hs,chipNr) && fScanObj->GetAverageMultiplicity(0,hs,chipNr)>0) { // check the status of the chippresent parameter in the mood header!!!!!!!!!!!!!!!!!!!!!!!!!!!!
227 UInt_t module = AliITSRawStreamSPD::GetModuleNumber(routerNr,hs*2+chipNr/5);
228 if (!fHandler[module]) {
229 fHandler[module] = new AliITSOnlineCalibrationSPDhandler(module);
231 fHandler[module]->SetFileLocation(oldcalibDir);
232 fHandler[module]->ReadFromFile();
233 if (fOverWrite) {fHandler[module]->ResetDead();}
234 for (UInt_t col=0; col<32; col++) {
235 for (UInt_t row=rowStart; row<=rowEnd; row++) {
236 if (col!=1 && col!=9 && col!=17 && col!=25) { //exclude test columns!!!
237 if (fScanObj->GetHits(0,hs,chipNr,col,row)==0) {
238 Int_t newCol = 32*(chipNr%5) + col;
239 if (fHandler[module]->SetDeadPixel(newCol,row)) {
254 Bool_t AliITSOnlineSPDscanAnalyzer::ProcessNoisyPixels(Char_t *oldcalibDir) {
255 // process noisy pixel data
256 if (fScanObj==NULL) {
257 printf("No data!\n");
260 // should be type kNOISE
261 if (fType != kNOISE) {
262 printf("Noisy pixels only for scan type %d\n",kNOISE);
267 for (Int_t i=0; i<240; i++) {
270 if (fScanObj->GetTriggers(0)<fNoiseMinimumEvents) {
271 printf("Error: Process noisy: Too few events.\n");
274 UInt_t routerNr = fScanObj->GetRouterNr();
275 for (UInt_t hs=0; hs<6; hs++) {
276 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
277 if (fScanObj->GetChipPresent(hs,chipNr)) { // check the status of the chippresent parameter in the mood header!!!!!!!!!!!!!!!!!!!!!!!!!!!!
278 UInt_t module = AliITSRawStreamSPD::GetModuleNumber(routerNr,hs*2+chipNr/5);
279 for (UInt_t col=0; col<32; col++) {
280 for (UInt_t row=0; row<256; row++) {
281 if (fScanObj->GetHitsEfficiency(0,hs,chipNr,col,row)>fNoiseThreshold) {
282 if (!fHandler[module]) {
283 fHandler[module] = new AliITSOnlineCalibrationSPDhandler(module);
285 fHandler[module]->SetFileLocation(oldcalibDir);
286 fHandler[module]->ReadFromFile();
287 if (fOverWrite) {fHandler[module]->ResetNoisy();}
288 Int_t newCol = 32*(chipNr%5) + col;
289 if (fHandler[module]->SetNoisyPixel(newCol,row)) {
301 Bool_t AliITSOnlineSPDscanAnalyzer::SaveDeadNoisyPixels(UInt_t module, Char_t *calibDir) {
302 // save dead and noisy pixels to file in dir calibDir
303 if (fHandler[module]!=NULL) {
304 fHandler[module]->SetFileLocation(calibDir);
305 fHandler[module]->WriteToFile();
314 Int_t AliITSOnlineSPDscanAnalyzer::GetDelay(UInt_t hs, UInt_t chipNr) {
316 if (hs>=6 || chipNr>10) return -1;
317 if (fScanObj==NULL) {
318 printf("No data!\n");
321 // should be type kDELAY or kDAC with id 42 (delay_ctrl)
322 if (fType!=kDELAY && (fType!=kDAC || fDacId!=42)) {
323 printf("Delay only for scan type %d or %d and dac_id 42\n",kDELAY,kDAC);
326 if (fMeanMultiplicity[hs][chipNr]==NULL) {
327 if (!ProcessMeanMultiplicity()) {
334 for (UInt_t step=0; step<fScanObj->GetNSteps(); step++) {
337 fMeanMultiplicity[hs][chipNr]->GetPoint(step,thisDac,thisMult);
338 if (thisMult > maxVal) {
345 return ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(maxStep);
354 // ********** old version of "GetDelay", which fits a gaussian to the meanmult graph
355 //Int_t AliITSOnlineSPDscanAnalyzer::GetDelay(UInt_t hs, UInt_t chipNr) {
357 // if (hs>=6 || chipNr>10) return -1;
358 // if (fScanObj==NULL) {
359 // printf("No data!\n");
362 // // should be type kDELAY or kDAC with id 42 (delay_ctrl)
363 // if (fType!=kDELAY && (fType!=kDAC || fDacId!=42)) {
364 // printf("Delay only for scan type %d or %d and dac_id 42\n",kDELAY,kDAC);
367 // if (fMeanMultiplicity[hs][chipNr]==NULL) {
368 // if (!ProcessMeanMultiplicity()) {
373 // Char_t funcName[30];
374 // sprintf(funcName,"Fit delay func HS%d CHIP%d",hs,chipNr);
375 // Int_t minDac = ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(0);
376 // Int_t maxDac = ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(fScanObj->GetNSteps()-1);
377 // TF1* delayFunc = new TF1(funcName,"gaus",minDac,maxDac);
378 // fMeanMultiplicity[hs][chipNr]->Fit(funcName,"Q0");
379 // Double_t mean = delayFunc->GetParameter(1);
380 // // Double_t sigma = fDelayFunc[hs][chipNr]->GetParameter(2);
382 // if (mean>minDac && mean<maxDac) {
383 // return (Int_t) (mean+0.5);
390 Int_t AliITSOnlineSPDscanAnalyzer::GetNrNoisyUnima(UInt_t hs, UInt_t chipNr) {
391 // in case of a uniformity scan, returns the nr of noisy pixels, (here > 200 hits)
392 if (hs>=6 || chipNr>10) return -1;
393 if (fScanObj==NULL) {
394 printf("No data!\n");
397 // should be type kUNIMA
398 if (fType != kUNIMA) {
399 printf("Noisy pixels Unima only for scan type %d\n",kUNIMA);
402 if (fScanObj->GetTriggers(0)!=25600) {
403 printf("Error: Process noisy unima: Incorrect number of events (!=25600.\n");
408 if (fScanObj->GetChipPresent(hs,chipNr)) { // check the status of the chippresent parameter in the mood header!!!!!!!!!!!!!!!!!!!!!!!!!!!!
409 for (UInt_t col=0; col<32; col++) {
410 for (UInt_t row=0; row<256; row++) {
411 if (fScanObj->GetHits(0,hs,chipNr,col,row)>200) {
423 Int_t AliITSOnlineSPDscanAnalyzer::FindLastMinThDac(UInt_t hs, UInt_t chipNr) {
424 // returns dac value where fMinIncreaseFromBaseLine reached
425 if (hs>=6 || chipNr>10) return -1;
426 if (fMeanMultiplicity[hs][chipNr]==NULL) {
427 if (!ProcessMeanMultiplicity()) {
431 Double_t firstVal, dummy1;
432 fMeanMultiplicity[hs][chipNr]->GetPoint(0,dummy1,firstVal);
434 while (step<fScanObj->GetNSteps()-1) {
435 Double_t graphVal, dummy2;
436 fMeanMultiplicity[hs][chipNr]->GetPoint(step+1,dummy2,graphVal);
437 if (graphVal>firstVal+fMinIncreaseFromBaseLine) break;
440 if (step==fScanObj->GetNSteps()-1) return -1;
441 return ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step);
444 Int_t AliITSOnlineSPDscanAnalyzer::FindClosestLowerStep(Float_t dacValueInput) {
445 // returns step closest (lower) to a dacvalue
447 while (step<fScanObj->GetNSteps()-1) {
448 Int_t dacVal = ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step+1);
449 if (dacVal>=dacValueInput) break;
455 Float_t AliITSOnlineSPDscanAnalyzer::GetCompareLine(UInt_t step, UInt_t hs, UInt_t chipNr, Float_t basePar2) {
456 // returns value to compare mean mult with (when finding min th)
457 if (hs>=6 || chipNr>10) return -1;
458 if (step<fMinNrStepsBeforeIncrease) return -1;
459 Float_t baseLine = basePar2;
460 if (baseLine<0) baseLine=0;
465 for (UInt_t st=1;st<2*step/3;st++) { // skip first point...
466 fMeanMultiplicity[hs][chipNr]->GetPoint(st,d,m);
468 baseS+=(m-baseLine)*(m-baseLine);
470 baseAdd=2*sqrt( baseS/(2*step/3-1) - (baseM/(2*step/3-1))*(baseM/(2*step/3-1)) );
471 baseAdd+=0.03; // magic number
472 if (baseAdd>fMinIncreaseFromBaseLine) baseAdd=fMinIncreaseFromBaseLine;
473 return baseLine + baseAdd;
476 Int_t AliITSOnlineSPDscanAnalyzer::GetMinTh(UInt_t hs, UInt_t chipNr) {
477 // calculates and returns the minimum threshold
478 if (hs>=6 || chipNr>10) return -1;
479 if (fScanObj==NULL) {
480 printf("No data!\n");
483 // should be type kMINTH or kDAC with id 39 (pre_vth)
484 if (fType!=kMINTH && (fType!=kDAC || fDacId!=39)) {
485 printf("MinTh only for scan type %d OR %d with dac_id 39\n",kMINTH,kDAC);
488 if (fMeanMultiplicity[hs][chipNr]==NULL) {
489 if (!ProcessMeanMultiplicity()) {
494 Int_t lastDac = FindLastMinThDac(hs,chipNr);
496 printf("GetMinTh: HS%d, Chip%d: Increase of Mean Multiplicity by %1.2f never reached.\n",hs,chipNr,fMinIncreaseFromBaseLine);
500 Int_t minDac = ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(0);
502 sprintf(funcName,"Fit minth func HS%d CHIP%d",hs,chipNr);
503 TF1 *minThFunc = new TF1(funcName,itsSpdErrorf,100,500,3);
504 minThFunc->SetParameter(0,lastDac+10);
505 minThFunc->SetParameter(1,2);
506 minThFunc->SetParameter(2,0);
507 minThFunc->SetParName(0,"Mean");
508 minThFunc->SetParName(1,"Sigma");
509 minThFunc->SetParName(2,"BaseLine");
510 minThFunc->SetLineWidth(1);
511 if (fMeanMultiplicity[hs][chipNr]==NULL) {
512 if (!ProcessMeanMultiplicity()) {
516 fMeanMultiplicity[hs][chipNr]->Fit(funcName,"Q0","",minDac,lastDac);
518 // Double_t mean = fMinThFunc[hs][chipNr]->GetParameter(0);
519 // Double_t sigma = fMinThFunc[hs][chipNr]->GetParameter(1);
520 Double_t baseLine = minThFunc->GetParameter(2);
523 if (baseLine>fMaxBaseLineLevel) {
524 printf("GetMinTh: HS%d, Chip%d: BaseLine too large (%1.2f>%1.2f)\n",hs,chipNr,baseLine,fMaxBaseLineLevel);
527 UInt_t step=FindClosestLowerStep(lastDac);
528 Float_t compareLine = GetCompareLine(step,hs,chipNr,baseLine);
529 if (compareLine==-1) {
530 printf("GetMinTh: HS%d, Chip%d: Not enough steps (%d<%d) before increase to get a compare line.\n",hs,chipNr,step,fMinNrStepsBeforeIncrease);
534 Double_t mult, dummy;
536 while (mult > compareLine && step>0) {
537 fMeanMultiplicity[hs][chipNr]->GetPoint(step,dummy,mult);
540 Int_t minth = ((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step+1)-fStepDownDacSafe;
546 printf("GetMinTh: HS%d, Chip%d: Did not find a point below the compare line (%f).\n",hs,chipNr,compareLine);
553 Bool_t AliITSOnlineSPDscanAnalyzer::ProcessMeanMultiplicity() {
554 // process mean multiplicity data
555 if (fScanObj==NULL) {
556 printf("No data!\n");
559 for (UInt_t step=0; step<fScanObj->GetNSteps(); step++) {
560 for (UInt_t hs=0; hs<6; hs++) {
561 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
562 // if (fScanObj->GetChipPresent(hs,chipNr)) { // check the status of the chippresent parameter in the mood header!!!!!!!!!!!!!!!!!!!!!!!!!!!!
564 if (fMeanMultiplicity[hs][chipNr]!=NULL) {
565 delete fMeanMultiplicity[hs][chipNr];
567 fMeanMultiplicity[hs][chipNr] = new TGraph();
569 Float_t multiplMean=fScanObj->GetAverageMultiplicity(step,hs,chipNr);
570 if (fType==kMINTH || fType==kMEANTH || fType==kDAC || fType==kDELAY) {
571 fMeanMultiplicity[hs][chipNr]->SetPoint(step,((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step),multiplMean);
574 fMeanMultiplicity[hs][chipNr]->SetPoint(step,0,multiplMean);
583 TGraph* AliITSOnlineSPDscanAnalyzer::GetMeanMultiplicityG(UInt_t hs, UInt_t chipNr) {
584 // returns mean multiplicity graph
585 if (hs>=6 || chipNr>10) return NULL;
586 if (fMeanMultiplicity[hs][chipNr]==NULL) {
587 if (!ProcessMeanMultiplicity()) {
591 return fMeanMultiplicity[hs][chipNr];
594 Bool_t AliITSOnlineSPDscanAnalyzer::ProcessHitEventEfficiency() {
595 // process hit event efficiency
596 if (fScanObj==NULL) {
597 printf("No data!\n");
600 for (UInt_t step=0; step<fScanObj->GetNSteps(); step++) {
601 for (UInt_t hs=0; hs<6; hs++) {
602 for (UInt_t chipNr=0; chipNr<11; chipNr++) {
603 // if (fScanObj->GetChipPresent(hs,chipNr)) { // check the status of the chippresent parameter in the mood header!!!!!!!!!!!!!!!!!!!!!!!!!!!!
605 if (fHitEventEfficiency[hs][chipNr]!=NULL) {
606 delete fHitEventEfficiency[hs][chipNr];
608 fHitEventEfficiency[hs][chipNr] = new TGraph();
610 Float_t efficiency=fScanObj->GetHitEventsEfficiency(step,hs,chipNr);
611 if (fType==kMINTH || fType==kMEANTH || fType==kDAC || fType==kDELAY) {
612 fHitEventEfficiency[hs][chipNr]->SetPoint(step,((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step),efficiency);
615 fHitEventEfficiency[hs][chipNr]->SetPoint(step,0,efficiency);
624 TGraph* AliITSOnlineSPDscanAnalyzer::GetHitEventEfficiencyG(UInt_t hs, UInt_t chipNr) {
625 // returns hit event efficiency graph
626 if (hs>=6 || chipNr>10) return NULL;
627 if (fHitEventEfficiency[hs][chipNr]==NULL) {
628 if (!ProcessHitEventEfficiency()) {
632 return fHitEventEfficiency[hs][chipNr];
636 Bool_t AliITSOnlineSPDscanAnalyzer::ProcessNrTriggers() {
637 // process nr of triggers data
638 if (fScanObj==NULL) {
639 printf("No data!\n");
642 for (UInt_t step=0; step<fScanObj->GetNSteps(); step++) {
644 if (fTriggers!=NULL) {
647 fTriggers = new TGraph();
649 if (fType==kMINTH || fType==kMEANTH || fType==kDAC || fType==kDELAY) {
650 fTriggers->SetPoint(step,((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step),fScanObj->GetTriggers(step));
653 fTriggers->SetPoint(step,0,fScanObj->GetTriggers(step));
659 TGraph* AliITSOnlineSPDscanAnalyzer::GetNrTriggersG() {
660 // returns nr of triggers graph
661 if (fTriggers==NULL) {
662 if (!ProcessNrTriggers()) {
669 Bool_t AliITSOnlineSPDscanAnalyzer::GetHalfStavePresent(UInt_t hs) {
670 // returns half stave present info
671 if (hs<6 && fScanObj!=NULL) {
673 for (Int_t chip=0; chip<10; chip++) {
674 chipstatus+=fScanObj->GetChipPresent(hs,chip);
676 if (chipstatus>0) return kTRUE;
681 AliITSOnlineCalibrationSPDhandler* AliITSOnlineSPDscanAnalyzer::GetOnlineCalibrationHandler(UInt_t module) {
682 // returns a pointer to the AliITSOnlineCalibrationSPDhandler
683 if (module<240) return fHandler[module];
687 UInt_t AliITSOnlineSPDscanAnalyzer::GetRouterNr() {
688 // returns the router nr of scan obj
689 if (fScanObj!=NULL) return fScanObj->GetRouterNr();
693 TH2F* AliITSOnlineSPDscanAnalyzer::GetHitMapTot(UInt_t step) {
694 // creates and returns a pointer to a hitmap histo (half sector style a la spdmood)
695 if (fScanObj==NULL) {
696 printf("No data!\n");
699 Char_t histoname[50];
700 if (fType==kMINTH || fType==kMEANTH || fType==kDAC) {
701 sprintf(histoname,"Router %d , DAC %d",GetRouterNr(),((AliITSOnlineSPDscanMultiple*)fScanObj)->GetDacValue(step));
704 sprintf(histoname,"Router %d ",GetRouterNr());
706 TH2F* fHitMapTot = new TH2F(histoname,histoname,32*10,-0.5,32*10-0.5,256*6,-0.5,256*6-0.5);
707 fHitMapTot->SetNdivisions(-10,"X");
708 fHitMapTot->SetNdivisions(-006,"Y");
709 fHitMapTot->SetTickLength(0,"X");
710 fHitMapTot->SetTickLength(0,"Y");
711 fHitMapTot->GetXaxis()->SetLabelColor(gStyle->GetCanvasColor());
712 fHitMapTot->GetYaxis()->SetLabelColor(gStyle->GetCanvasColor());
713 for (UInt_t hs=0; hs<6; hs++) {
714 for (UInt_t chipNr=0; chipNr<10; chipNr++) {
715 for (UInt_t col=0; col<32; col++) {
716 for (UInt_t row=0; row<256; row++) {
717 fHitMapTot->Fill(chipNr*32+col,(5-hs)*256+row,fScanObj->GetHits(step,hs,chipNr,col,row));