- // loop over the trigger DDL (Right: 20, Left: 21)
- for (Int_t iDDL = 20; iDDL <= 21; ++iDDL) {
- AliMpDDL* ddl = ddlStore->GetDDL(iDDL);
- Int_t nCrate = ddl->GetNofTriggerCrates();
- // loop over the number of crates in DDL
- for (Int_t index = 0; index < nCrate; ++index) {
- // get crate object
- AliMpTriggerCrate* crate = ddlStore->GetTriggerCrate(iDDL, index);
- Int_t nLocal = crate->GetNofLocalBoards();
- for (Int_t iLocal = 0; iLocal < nLocal; ++iLocal) {
- // get local board Id from crate object
- localId = crate->GetLocalBoardId(iLocal);
- // get local board object
- AliMpLocalBoard* localBoard = ddlStore->GetLocalBoard(localId);
-
- if (!localBoard->IsNotified()) continue;
-
- // get detection element connected to this board
- for (Int_t ch = 0; ch < fgkNchambers; ++ch) {
- Int_t iCh = ch + AliMpConstants::NofTrackingChambers();
- Int_t detElemId = ddlStore->GetDEfromLocalBoard(localId, iCh);
-
- if (!detElemId) continue;
-
- // get segmentation
- for (Int_t cath = 0; cath < fgkNcathodes; ++cath) {
- const AliMpVSegmentation* seg = AliMpSegmentation::Instance()
- ->GetMpSegmentation(detElemId,
- AliMp::GetCathodType(cath));
-
- Int_t chCath = fgkNchambers*cath + ch;
- slat = detElemId%100;
- Int_t nStrips=0;
-
- // loop over strips
- for (Int_t ibitxy = 0; ibitxy < 16; ++ibitxy) {
- // get pad from electronics
- AliMpPad pad = seg->PadByLocation(AliMpIntPair(localId,
- ibitxy),kFALSE);
-
- if (!pad.IsValid()) continue;
- if(cath==0){ // Geometry info from bending plane only
- if(ibitxy==0) {
- xLocal1 = pad.Position().X();
- yLocal1 = pad.Position().Y();
- xWidth = pad.Dimensions().X();
- yWidth = pad.Dimensions().Y();
- }
- xLocal2 = pad.Position().X();
- yLocal2 = pad.Position().Y();
- }
-
- // Check fired pads (when available)
- if(padFired[cath]) {
- Int_t padX = pad.GetIndices().GetFirst();
- Int_t padY = pad.GetIndices().GetSecond();
- Int_t currPair = padX*maxY[cath] + padY;
- nStrips++;
- //printf("cath %i board = %i (%2i, %2i) -> %i\n",
- //cath, localId, padX, padY, currPair);
- Int_t chBin = padFired[cath]->GetXaxis()->FindBin(ch);
- Int_t slatBin = padFired[cath]->GetYaxis()->FindBin(slat);
- Int_t pairBin = padFired[cath]->GetZaxis()->FindBin(currPair);
- Float_t nFired = padFired[cath]->GetBinContent(chBin, slatBin, pairBin);;
-
- Float_t dimX = pad.Dimensions().X();
- Float_t dimY = pad.Dimensions().Y();
-
- Float_t stripX1 = pad.Position().X();
- Float_t stripY1 = pad.Position().Y();
- Float_t stripX2 = pad.Position().X();
- Float_t stripY2 = pad.Position().Y();
-
- transform->Local2Global(detElemId, stripX1, stripY1, 0, xg1, yg1, zg1);
- transform->Local2Global(detElemId, stripX2, stripY2, 0, xg2, yg2, zg2);
-
- Float_t x1Float = TMath::Min(xg1,xg2) - dimX;
- Float_t y1Float = TMath::Min(yg1,yg2) - dimY;
- Float_t x2Float = TMath::Max(xg1,xg2) + dimX;
- Float_t y2Float = TMath::Max(yg1,yg2) + dimY;
-
- Int_t x1Int = histoFiredDisplay[chCath]->GetXaxis()->FindBin(x1Float)+1;
- Int_t y1Int = histoFiredDisplay[chCath]->GetYaxis()->FindBin(y1Float)+1;
- Int_t x2Int = histoFiredDisplay[chCath]->GetXaxis()->FindBin(x2Float)-1;
- Int_t y2Int = histoFiredDisplay[chCath]->GetYaxis()->FindBin(y2Float)-1;
-
- for(Int_t binX=x1Int; binX<=x2Int; binX++){
- for(Int_t binY=y1Int; binY<=y2Int; binY++){
- histoFiredDisplay[chCath]->SetBinContent(binX, binY, nFired);
- }
- }
-
- if(nFired==0.) nFired = kDummyFired;
- histoFired[chCath][localId-1]->Fill(ibitxy, nFired);
- }
- } // loop on strips
-
- if(cath==0){ // Geometry info from bending plane only
- transform->Local2Global(detElemId, xLocal1, yLocal1, 0, xg1, yg1, zg1);
- transform->Local2Global(detElemId, xLocal2, yLocal2, 0, xg2, yg2, zg2);
-
- // Per board
- x1Label = TMath::Min(xg1,xg2) - xWidth;
- y1Label = TMath::Min(yg1,yg2) - yWidth;
- x2Label = TMath::Max(xg1,xg2) + xWidth;
- y2Label = TMath::Max(yg1,yg2) + yWidth;
-
- x1 = histo[ch]->GetXaxis()->FindBin(x1Label)+1;
- y1 = histo[ch]->GetYaxis()->FindBin(y1Label)+1;
- x2 = histo[ch]->GetXaxis()->FindBin(x2Label)-1;
- y2 = histo[ch]->GetYaxis()->FindBin(y2Label)-1;
-
- sprintf(labelTxt,"%3d", localId);
-
- // Per slat
- line = localBoard->GetPosition().GetFirst();
- x1LabelSlat = 140.;
- x2LabelSlat = x1LabelSlat + 40.;
- y1LabelSlat = -285. + ((Float_t)(line - 1)) * 68;
- y2LabelSlat = y1LabelSlat + 34.;
- if(localId>kNumOfBoards/2){
- x1LabelSlat = -x2LabelSlat;
- x2LabelSlat = x1LabelSlat + 40.;
- }
- sprintf(labelSlatTxt,"%2d", slat);
- }
-
- boardLabel[chCath][localId-1] = new TPaveLabel(x1Label, y1Label, x2Label, y2Label, labelTxt);
- boardLabel[chCath][localId-1]->SetFillStyle(0);
- boardLabel[chCath][localId-1]->SetBorderSize(0);
-
- boardLabelSlat[chCath][localId-1] = new TPaveLabel(x1LabelSlat, y1LabelSlat, x2LabelSlat, y2LabelSlat, labelSlatTxt);
- boardLabelSlat[chCath][localId-1]->SetFillStyle(0);
- boardLabelSlat[chCath][localId-1]->SetBorderSize(0);
-
- Int_t histoBin = localId;
- efficiency = fBoardEfficiency[chCath]->GetBinContent(histoBin);
- efficiencyError = fBoardEfficiency[chCath]->GetBinError(histoBin);
- if(efficiency==0.) efficiency = kDummyFired; // It allows to graphically distinguish
- // efficiency = 0 from no hit on board
-
- histoBin = slat+1;
- efficiencySlat = fSlatEfficiency[chCath]->GetBinContent(histoBin);
- efficiencySlatError = fSlatEfficiency[chCath]->GetBinError(histoBin);
- if(efficiencySlat==0.) efficiencySlat = kDummyFired; // It allows to graphically distinguish
- // efficiency = 0 from no hit on slat
-
- for(Int_t binX=x1; binX<=x2; binX++){
- for(Int_t binY=y1; binY<=y2; binY++){
- histo[chCath]->SetBinContent(binX, binY, efficiency);
- histo[chCath]->SetBinError(binX, binY, efficiencyError);
- histoSlat[chCath]->SetBinContent(binX, binY, efficiencySlat);
- histoSlat[chCath]->SetBinError(binX, binY, efficiencySlatError);
- }
- }
-
- // Check fired pads (when available)
- if(padFired[cath]) {
- histoFired[chCath][localId-1]->Fit("pol0","Q0R","",0., (Float_t)nStrips-1.);
- fitFunc = histoFired[chCath][localId-1]->GetFunction("pol0");
- Float_t chi2 = fitFunc->GetChisquare();
- Float_t ndf = (Float_t)fitFunc->GetNDF();
- Float_t reducedChi2 = chi2/ndf;
- if(reducedChi2>kChi2RedMax) {
- isStripOffInBoard[chCath][localId-1] = kTRUE;
- //printf("Chamber = %i Cath = %i Board %i: chi2/NDF = %f\tparam = %f\n", ch, cath, localId, reducedChi2, fitFunc->GetParameter(0));
- fFiredFitHistoList->Add(histoFired[chCath][localId-1]);
- }
- }
- } // loop on cathodes
- } // loop on chambers
- } // loop on boards
- } // loop on crates
- } // loop on DDL
-
- for(Int_t chCath=0; chCath<fgkNplanes; chCath++){
- for(Int_t ib=0; ib<kNumOfBoards; ib++){
- fBoardLabelList->Add(boardLabel[chCath][ib]);
- }
- }
- for(Int_t chCath=0; chCath<fgkNplanes; chCath++){
- for(Int_t ib=0; ib<kNumOfBoards; ib++){
- fBoardLabelList->Add(boardLabelSlat[chCath][ib]);
- }
- }
-
- return kTRUE;