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 **************************************************************************/
16 #include "AliITSOnlineSDDInjectors.h"
20 #include <TGraphErrors.h>
25 ///////////////////////////////////////////////////////////////////
27 // Implementation of the class used for SDD injector analysis //
28 // Origin: F.Prino, Torino, prino@to.infn.it //
30 ///////////////////////////////////////////////////////////////////
32 ClassImp(AliITSOnlineSDDInjectors)
34 const Float_t AliITSOnlineSDDInjectors::fgkSaturation = 1008.;
35 const Float_t AliITSOnlineSDDInjectors::fgkDefaultLThreshold = 5.;
36 const Float_t AliITSOnlineSDDInjectors::fgkDefaultHThreshold = 25.;
37 const Float_t AliITSOnlineSDDInjectors::fgkDefaultMinSpeed = 5.5;
38 const Float_t AliITSOnlineSDDInjectors::fgkDefaultMaxSpeed = 9.0;
39 const Float_t AliITSOnlineSDDInjectors::fgkDefaultMaxErr = 1.5;
40 const Int_t AliITSOnlineSDDInjectors::fgkDefaultPolDegree = 3;
41 const Float_t AliITSOnlineSDDInjectors::fgkDefaultTimeStep = 50.;
42 const UShort_t AliITSOnlineSDDInjectors::fgkDefaultTbMin[kInjLines] = {10,50,100};
43 const UShort_t AliITSOnlineSDDInjectors::fgkDefaultTbMax[kInjLines] = {20,70,120};
45 //______________________________________________________________________
46 AliITSOnlineSDDInjectors::AliITSOnlineSDDInjectors():AliITSOnlineSDD(),fHisto(),fTbZero(0.),fRMSTbZero(0.),fNEvents(0),fParam(),fPolDegree(0),fActualPolDegree(0),fMinDriftSpeed(0.),fMaxDriftSpeed(0.),fMaxDriftSpeedErr(0.),fLowThreshold(0.),fHighThreshold(0.),fFirstPadForFit(0),fLastPadForFit(0),fPadStatusCutForFit(0),fTimeStep(0.),fUseTimeZeroSignal(kFALSE)
48 // default constructor
51 SetTimeStep(fgkDefaultTimeStep);
53 //______________________________________________________________________
54 AliITSOnlineSDDInjectors::AliITSOnlineSDDInjectors(Int_t nddl, Int_t ncarlos, Int_t sid):AliITSOnlineSDD(nddl,ncarlos,sid),fHisto(),fTbZero(0.),fRMSTbZero(0.),fNEvents(0),fParam(),fPolDegree(0),fActualPolDegree(0),fMinDriftSpeed(0.),fMaxDriftSpeed(0.),fMaxDriftSpeedErr(0.),fLowThreshold(0.),fHighThreshold(0.),fFirstPadForFit(0),fLastPadForFit(0),fPadStatusCutForFit(0),fTimeStep(0.),fUseTimeZeroSignal(kFALSE)
56 // standard constructor
59 SetTimeStep(fgkDefaultTimeStep);
61 //______________________________________________________________________
62 AliITSOnlineSDDInjectors::~AliITSOnlineSDDInjectors(){
64 // fHisto should not be deleted here because it points to an histo created
65 // by the external code which calls the method AnalyzeEvent
66 // if(fHisto) delete fHisto;
67 if(fParam) delete [] fParam;
69 //______________________________________________________________________
70 void AliITSOnlineSDDInjectors::SetDefaults(){
71 for(Int_t i=0;i<kInjLines;i++) {
72 SetInjLineRange(i,fgkDefaultTbMin[i],fgkDefaultTbMax[i]);
75 SetThresholds(fgkDefaultLThreshold,fgkDefaultHThreshold);
76 SetPolDegree(fgkDefaultPolDegree);
77 SetMinDriftSpeed(fgkDefaultMinSpeed);
78 SetMaxDriftSpeed(fgkDefaultMaxSpeed);
79 SetMaxDriftSpeedErr(fgkDefaultMaxErr);
80 SetFitLimits(1,kInjPads-2); // exclude first and last pad
81 SetPadStatusCutForFit();
83 //______________________________________________________________________
84 void AliITSOnlineSDDInjectors::SetPositions(){
86 Double_t xLinFromCenterUm[kInjLines]={31860.,17460.,660.};
87 Double_t xAnodeFromCenterUm=35085;
88 for(Int_t i=0;i<kInjLines;i++){
89 fPosition[i]=xAnodeFromCenterUm-xLinFromCenterUm[i];
90 fPosition[i]/=10000.; // from microns to cm
93 //______________________________________________________________________
94 void AliITSOnlineSDDInjectors::Reset(){
96 for(Int_t i=0;i<kInjPads;i++){
100 for(Int_t i=0;i<kInjPads;i++){
101 for(Int_t j=0;j<kInjLines;j++){
104 fRMSCentroid[i][j]=0.;
108 //______________________________________________________________________
109 void AliITSOnlineSDDInjectors::AnalyzeEvent(TH2F* his){
112 FitDriftSpeedVsAnode();
114 //______________________________________________________________________
115 void AliITSOnlineSDDInjectors::AddEvent(TH2F* his){
116 // Add the drift speed from current event to the average value
118 for(Int_t i=0;i<kInjPads;i++){
119 fSumDriftSpeed[i]=0.;
120 fSumSqDriftSpeed[i]=0.;
128 for(Int_t j=0;j<kInjPads;j++){
130 fSumDriftSpeed[j]+=fDriftSpeed[j];
131 fSumSqDriftSpeed[j]+=fDriftSpeed[j]*fDriftSpeed[j];
135 //______________________________________________________________________
136 Double_t AliITSOnlineSDDInjectors::GetRMSDriftSpeed(Int_t ipad) const {
138 if(fNEvents<=1) return 0.;
139 Double_t mean=fSumDriftSpeed[ipad]/(Double_t)fNEvents;
140 Double_t diff=fSumSqDriftSpeed[ipad]/(Double_t)fNEvents-mean*mean;
142 return TMath::Sqrt(diff);
145 //______________________________________________________________________
146 void AliITSOnlineSDDInjectors::FitMeanDriftSpeedVsAnode(){
148 if(fNEvents==0) return;
149 for(Int_t i=0;i<kInjPads;i++){
150 fDriftSpeed[i]=GetMeanDriftSpeed(i);
152 Double_t rms=GetRMSDriftSpeed(i);
153 if(rms>0.) fDriftSpeedErr[i]=rms/TMath::Sqrt(fNEvents);
156 FitDriftSpeedVsAnode();
158 //______________________________________________________________________
159 TGraphErrors* AliITSOnlineSDDInjectors::GetTimeVsDistGraph(Int_t jpad) const{
161 const Int_t kPts=kInjLines+1;
162 Float_t x[kPts],y[kPts],ex[kPts],ey[kPts];
167 for(Int_t i=0;i<kInjLines;i++){
170 y[i+1]=fCentroid[jpad][i];
171 ey[i+1]=fRMSCentroid[jpad][i];
173 TGraphErrors *g=new TGraphErrors(4,x,y,ex,ey);
177 //______________________________________________________________________
178 TGraphErrors* AliITSOnlineSDDInjectors::GetDriftSpeedGraph() const{
181 TGraphErrors *g=new TGraphErrors(0);
182 for(Int_t i=0;i<kInjPads;i++){
183 if(fDriftSpeed[i]>0){
184 g->SetPoint(ipt,GetAnodeNumber(i),fDriftSpeed[i]);
185 g->SetPointError(ipt,0,fDriftSpeedErr[i]);
191 //______________________________________________________________________
192 TGraphErrors* AliITSOnlineSDDInjectors::GetSelectedDriftSpeedGraph(Int_t minAcceptStatus) const{
193 // TGraphErrors with only pads with status of injector >= minAcceptStatus
195 TGraphErrors *g=new TGraphErrors(0);
196 for(Int_t i=0;i<kInjPads;i++){
197 Int_t padStatus = GetInjPadStatus(i);
198 if(fDriftSpeed[i]>0 && padStatus >= minAcceptStatus ){
199 g->SetPoint(ipt,GetAnodeNumber(i),fDriftSpeed[i]);
200 g->SetPointError(ipt,0,fDriftSpeedErr[i]);
206 //______________________________________________________________________
207 void AliITSOnlineSDDInjectors::CalcTimeBinZero(){
208 // Get time zero from trigger signal
209 Double_t tzero=0.,intCont=0.,rmsPeak=0.;
210 Bool_t isTbUsed[256];
212 for(Int_t i=0;i<256;i++) isTbUsed[i]=0;
213 for(Int_t ian=0;ian<fgkNAnodes;ian++){
214 for(Int_t itb=1;itb<fTbMin[0];itb++){
215 Double_t cont=fHisto->GetBinContent(itb,ian+1);
216 Double_t contm1=fHisto->GetBinContent(itb+1,ian+1);
217 Double_t contp1=fHisto->GetBinContent(itb-1,ian+1);
218 if(cont>fLowThreshold){
219 if(contm1>fHighThreshold || cont>fHighThreshold || contp1>fHighThreshold){
220 tzero+=cont*float(itb);
221 rmsPeak+=cont*float(itb)*float(itb);
232 fTbZero=tzero/intCont;
233 fRMSTbZero=TMath::Sqrt(rmsPeak/intCont-fTbZero*fTbZero);
235 if(nTbUsed==1) fRMSTbZero=0.5;
238 //______________________________________________________________________
239 void AliITSOnlineSDDInjectors::FitDriftSpeedVsAnode(){
240 // fits the anode dependence of drift speed
242 Float_t rangeForMax[2]={78.,178.};
244 fActualPolDegree=fPolDegree;
246 Double_t deltasq=fParam[2]*fParam[2]-3*fParam[1]*fParam[3];
247 Double_t zero1=-999.;
248 Double_t zero2=-999.;
249 if(deltasq>=0. && TMath::Abs(fParam[3])>0.){
250 Double_t delta=TMath::Sqrt(deltasq);
251 zero1=(-fParam[2]+delta)/3./fParam[3];
252 zero2=(-fParam[2]-delta)/3./fParam[3];
254 Bool_t twoZeroes=kFALSE;
255 Bool_t oneZero=kFALSE;
256 if(zero1>0. && zero1<256. && zero2>0. && zero2<256.) twoZeroes=kTRUE;
257 if(zero1>rangeForMax[0] && zero1<rangeForMax[1]) oneZero=kTRUE;
258 if(zero2>rangeForMax[0] && zero2<rangeForMax[1]) oneZero=kTRUE;
259 if(!oneZero || twoZeroes){
262 if(fParam[2]<0.) xmax=-fParam[1]/2./fParam[2];
263 if(xmax>rangeForMax[0] && xmax<rangeForMax[1]){
266 Double_t averSpeed=0.;
269 for(Int_t jpad=fFirstPadForFit; jpad<=fLastPadForFit; jpad++){
270 if(fDriftSpeed[jpad]>0 && GetInjPadStatus(jpad)>fPadStatusCutForFit){
271 Double_t wei=1./fDriftSpeedErr[jpad]/fDriftSpeedErr[jpad];
272 averSpeed+=wei*fDriftSpeed[jpad];
277 if(sumWei>0.) averSpeed/=sumWei;
278 if(nUsedPts<fPolDegree+1) averSpeed=0;
280 for(Int_t i=1; i < fPolDegree+1; i++) fParam[i]=0.;
286 //______________________________________________________________________
287 void AliITSOnlineSDDInjectors::PolyFit(Int_t degree){
288 // fits the anode dependence of drift speed with a polynomial function
289 const Int_t kNn=degree+1;
290 const Int_t kDimens=fPolDegree+1;
292 Double_t **mat = new Double_t*[kNn];
293 for(Int_t i=0; i < kNn; i++) mat[i] = new Double_t[kNn];
294 Double_t *vect = new Double_t[kNn];
296 for(Int_t k1=0;k1<kNn;k1++){
298 for(Int_t k2=0;k2<kNn;k2++){
303 for(Int_t k1=0;k1<kNn;k1++){
304 for(Int_t jpad=fFirstPadForFit; jpad<=fLastPadForFit; jpad++){
305 Double_t x=(Double_t)GetAnodeNumber(jpad);
306 if(fDriftSpeed[jpad]>0 && GetInjPadStatus(jpad)>fPadStatusCutForFit){
307 vect[k1]+=fDriftSpeed[jpad]*TMath::Power(x,k1)/TMath::Power(fDriftSpeedErr[jpad],2);
309 for(Int_t k2=0;k2<kNn;k2++){
310 mat[k1][k2]+=TMath::Power(x,k1+k2)/TMath::Power(fDriftSpeedErr[jpad],2);
315 if(npts<fPolDegree+1){
316 if(fParam) delete [] fParam;
317 fParam=new Double_t[kDimens];
318 for(Int_t i=0; i<kDimens;i++)fParam[i]=0;
320 Int_t *iPivot = new Int_t[kNn];
321 Int_t *indxR = new Int_t[kNn];
322 Int_t *indxC = new Int_t[kNn];
323 for(Int_t i=0;i<kNn;i++) iPivot[i]=0;
324 Int_t iCol=-1,iRow=-1;
325 for(Int_t i=0;i<kNn;i++){
327 for(Int_t j=0;j<kNn;j++){
329 for(Int_t k=0;k<kNn;k++){
331 if(TMath::Abs(mat[j][k])>=big){
332 big=TMath::Abs(mat[j][k]);
343 for(Int_t l=0;l<kNn;l++){
345 mat[iRow][l]=mat[iCol][l];
349 vect[iRow]=vect[iCol];
354 if(mat[iCol][iCol]==0) break;
355 Double_t pivinv=1./mat[iCol][iCol];
357 for(Int_t l=0;l<kNn;l++) mat[iCol][l]*=pivinv;
359 for(Int_t m=0;m<kNn;m++){
363 for(Int_t n=0;n<kNn;n++) mat[m][n]-=mat[iCol][n]*aux;
364 vect[m]-=vect[iCol]*aux;
373 if(fParam) delete [] fParam;
374 fParam=new Double_t[kDimens];
375 for(Int_t i=0; i<kNn;i++)fParam[i]=vect[i];
376 if(degree<fPolDegree) for(Int_t i=kNn; i<kDimens;i++)fParam[i]=0.;
379 for(Int_t i=0; i < kNn; i++) delete [] mat[i];
383 //______________________________________________________________________
384 void AliITSOnlineSDDInjectors::CalcDriftSpeed(Int_t jpad){
386 Double_t sumY=0,sumX=0,sumXX=0,sumYY=0.,sumXY=0,sumWEI=0.;
388 Double_t y[kInjLines],ey[kInjLines];
389 Double_t tzero=0,erry=0;
390 for(Int_t i=0;i<kInjLines;i++){
391 y[i]=fCentroid[jpad][i];
392 ey[i]=fRMSCentroid[jpad][i];
394 for(Int_t i=0;i<kInjLines;i++){
395 if(!fUseLine[i]) continue;
396 if(fGoodInj[jpad][i] && ey[i]!=0){
397 sumY+=y[i]/ey[i]/ey[i];
398 sumX+=fPosition[i]/ey[i]/ey[i];
399 sumXX+=fPosition[i]*fPosition[i]/ey[i]/ey[i];
400 sumYY+=y[i]*y[i]/ey[i]/ey[i];
401 sumXY+=fPosition[i]*y[i]/ey[i]/ey[i];
402 sumWEI+=1./ey[i]/ey[i];
403 tzero=fTbZero/ey[i]/ey[i];
404 erry=ey[i]/ey[i]/ey[i];
408 Double_t slope=0.,eslope=0.;
410 slope=(sumY-tzero)/sumX;
414 if(fUseTimeZeroSignal){
415 sumY+=fTbZero/fRMSTbZero/fRMSTbZero;
418 sumYY+=fTbZero*fTbZero/fRMSTbZero/fRMSTbZero;
420 sumWEI+=1./fRMSTbZero/fRMSTbZero;
422 slope=(sumWEI*sumXY-sumY*sumX)/(sumWEI*sumXX-sumX*sumX);
423 eslope=TMath::Sqrt(sumWEI/(sumWEI*sumXX-sumX*sumX));
426 Double_t vel=0,evel=0;
427 if(slope!=0. && fTimeStep>0.){
428 vel=1./slope*10000./fTimeStep;// micron/ns
429 evel=eslope/slope/slope*10000./fTimeStep;// micron/ns
431 if(vel>fMaxDriftSpeed||vel<fMinDriftSpeed || evel>fMaxDriftSpeedErr){
435 fDriftSpeed[jpad]=vel;
436 fDriftSpeedErr[jpad]=evel;
438 //______________________________________________________________________
439 Int_t AliITSOnlineSDDInjectors::GetAnodeNumber(Int_t iInjPad) const{
440 // Injectors location along anodes:
441 // Side left (UP) - channel 0: injectors on anodes 0,7,15,...,247,255
442 // Side right (DOWN) - channel 1: injectors on anodes 0,8,16,...,248,255
444 if(iInjPad>=kInjPads) return ian;
445 if(fSide==1){ // right side
447 if(iInjPad==32) ian--;
450 if(iInjPad==0) ian=0;
454 //______________________________________________________________________
455 Int_t AliITSOnlineSDDInjectors::GetInjPadNumberFromAnode(Int_t nAnode) const{
458 if(fSide==1){ // right side
459 if(nAnode%8==0) iInjPad=nAnode/8;
460 if(nAnode==255) iInjPad=32;
462 if(nAnode%8==7) iInjPad=1+nAnode/8;
463 if(nAnode==0) iInjPad=0;
465 if(nAnode>=256) iInjPad=-1;
468 //______________________________________________________________________
469 Int_t AliITSOnlineSDDInjectors::GetInjPadStatus(Int_t jpad) const{
470 // returns an integer value with status of injector lines for given pad/anode
471 // status=7 --> 111 all injector are good
472 // status=6 --> 110 1st line (close to anodes) is bad, other two are good
474 // status=1 --> 001 only 1st line (close to anodes) good
475 // status=0 --> 000 all lines are bad
477 if(jpad>=0 && jpad<kInjPads){
478 for(Int_t jlin=0;jlin<kInjLines;jlin++) istatus+=fGoodInj[jpad][jlin]<<jlin;
482 //______________________________________________________________________
483 void AliITSOnlineSDDInjectors::FindGoodInjectors(){
485 for(Int_t jpad=0;jpad<kInjPads;jpad++){
486 Int_t ian=GetAnodeNumber(jpad);
487 for(Int_t jlin=0;jlin<kInjLines;jlin++){
488 for(Int_t jjj=fTbMin[jlin];jjj<fTbMax[jlin];jjj++){
489 Float_t c1=fHisto->GetBinContent(jjj,ian+1);
490 Float_t c2=fHisto->GetBinContent(jjj+1,ian+1);
491 // Float_t c3=fHisto->GetBinContent(jjj+2,ian+1);
492 if(c1>fLowThreshold && c2>fLowThreshold){
493 if(c1>fHighThreshold || c2>fHighThreshold){
494 fGoodInj[jpad][jlin]=1;
502 //______________________________________________________________________
503 void AliITSOnlineSDDInjectors::FindCentroids(){
505 for(Int_t jpad=0;jpad<kInjPads;jpad++){
506 Int_t ian=GetAnodeNumber(jpad);
507 for(Int_t jlin=0;jlin<kInjLines;jlin++){
508 if(!fGoodInj[jpad][jlin]) continue;
511 for(Int_t jjj=fTbMin[jlin];jjj<fTbMax[jlin];jjj++){
512 Double_t cont=fHisto->GetBinContent(jjj,ian+1);
521 Double_t cont=fHisto->GetBinContent(jjj,ian+1);
522 if(cont<fLowThreshold) break;
523 if(cont<fgkSaturation){
524 fCentroid[jpad][jlin]+=cont*(Double_t)jjj;
525 fRMSCentroid[jpad][jlin]+=cont*(Double_t)jjj*(Double_t)jjj;
532 Double_t cont=fHisto->GetBinContent(jjj,ian+1);
533 if(cont<fLowThreshold) break;
534 if(cont<fgkSaturation){
535 fCentroid[jpad][jlin]+=cont*float(jjj);
536 fRMSCentroid[jpad][jlin]+=cont*(Double_t)jjj*(Double_t)jjj;
542 fCentroid[jpad][jlin]/=intCont;
543 fRMSCentroid[jpad][jlin]=TMath::Sqrt(fRMSCentroid[jpad][jlin]/intCont-fCentroid[jpad][jlin]*fCentroid[jpad][jlin])/TMath::Sqrt(intCont);
546 fCentroid[jpad][jlin]=0.;
547 fRMSCentroid[jpad][jlin]=0.;
548 fGoodInj[jpad][jlin]=0;
550 if(fRMSCentroid[jpad][jlin]==0) fGoodInj[jpad][jlin]=0;
554 //______________________________________________________________________
555 void AliITSOnlineSDDInjectors::PrintInjectorStatus(){
557 for(Int_t jpad=0;jpad<kInjPads;jpad++){
558 printf("Line%d-Anode%d: %d %d %d\n",jpad,GetAnodeNumber(jpad),fGoodInj[jpad][0],fGoodInj[jpad][1],fGoodInj[jpad][2]);
561 //______________________________________________________________________
562 void AliITSOnlineSDDInjectors::PrintCentroids(){
564 for(Int_t jpad=0;jpad<kInjPads;jpad++){
565 printf("Line%d-Anode%d: %f+-%f %f+-%f %f+-%f\n",jpad,GetAnodeNumber(jpad),fCentroid[jpad][0],fRMSCentroid[jpad][0],fCentroid[jpad][1],fRMSCentroid[jpad][1],fCentroid[jpad][2],fRMSCentroid[jpad][2]);
568 //______________________________________________________________________
569 void AliITSOnlineSDDInjectors::WriteToASCII(Int_t evNumb, UInt_t timeStamp, Int_t optAppend){
571 Char_t outfilnam[100];
572 sprintf(outfilnam,"SDDinj_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
575 outf=fopen(outfilnam,"w");
576 fprintf(outf,"%d\n",fActualPolDegree);
578 else outf=fopen(outfilnam,"a");
579 fprintf(outf,"%d %d ",evNumb,timeStamp);
580 for(Int_t ic=0;ic<fPolDegree+1;ic++){
581 fprintf(outf,"%G ",fParam[ic]);
586 //______________________________________________________________________
587 TH1F* AliITSOnlineSDDInjectors::GetMeanDriftSpeedVsPadHisto() const{
589 sprintf(hisnam,"hdrsp%02dc%02ds%d",fDDL,fCarlos,fSide);
590 TH1F* h=new TH1F(hisnam,"",kInjPads,-0.5,kInjPads-0.5);
592 for(Int_t i=0;i<kInjPads;i++){
593 h->SetBinContent(i+1,GetMeanDriftSpeed(i));
594 Double_t rms=GetRMSDriftSpeed(i);
596 if(rms>0.) err=rms/TMath::Sqrt(fNEvents);
597 h->SetBinError(i+1,err);
602 //______________________________________________________________________
603 Bool_t AliITSOnlineSDDInjectors::WriteToROOT(TFile *fil) const {
606 AliWarning("Invalid pointer to ROOT file");
611 sprintf(hisnam,"hdrsp%02dc%02ds%d",fDDL,fCarlos,fSide);
612 TH1F hdsp(hisnam,"",kInjPads,-0.5,kInjPads-0.5);
614 AliWarning("Zero analyzed events");
618 for(Int_t i=0;i<kInjPads;i++){
619 hdsp.SetBinContent(i+1,GetMeanDriftSpeed(i));
620 Double_t rms=GetRMSDriftSpeed(i);
622 if(rms>0.) err=rms/TMath::Sqrt(fNEvents);
623 hdsp.SetBinError(i+1,err);
628 //______________________________________________________________________
629 void AliITSOnlineSDDInjectors::WriteInjectorStatusToASCII(){
630 // dump status of injectors encoded into UInt_t
631 // 5 bits (value 0-31) to store number of pads with given status
632 Char_t outfilnam[100];
633 sprintf(outfilnam,"SDDinj_ddl%02dc%02d_sid%d.data",fDDL,fCarlos,fSide);
634 FILE* outf=fopen(outfilnam,"a");
635 Int_t n[8]={0,0,0,0,0,0,0,0};
636 for(Int_t jpad=fFirstPadForFit; jpad<=fLastPadForFit; jpad++){
637 Int_t statusPad=GetInjPadStatus(jpad);
641 statusInj+=(n[7]&0x1F)<<25; // bits 25-29: n. of pads with status 7
642 statusInj+=(n[6]&0x1F)<<20; // bits 20-24: n. of pads with status 6
643 statusInj+=(n[5]&0x1F)<<15; // bits 15-19: n. of pads with status 5
644 statusInj+=(n[4]&0x1F)<<10; // bits 10-14: n. of pads with status 4
645 statusInj+=(n[3]&0x1F)<<5; // bits 5- 9: n. of pads with status 3
646 statusInj+=(n[2]&0x1F); // bits 0- 4: n. of pads with status 2
648 fprintf(outf,"-99 %u\n",statusInj); // -99 used in preprocessor to find line
649 // with injector status info