1 /////////////////////////////////////////
2 // Class for SDD digits preprocessing //
5 ////////////////////////////////////////
7 #include "AliITSPreprocessorSDD.h"
8 #include "AliITSCalibrationSDD.h"
9 #include "AliShuttleInterface.h"
10 #include "AliCDBMetaData.h"
11 #include "TObjArray.h"
16 const Int_t AliITSPreprocessorSDD::fgkNumberOfSDD = 260;
17 const Int_t AliITSPreprocessorSDD::fgkNumberOfChannels = 512;
18 const TString AliITSPreprocessorSDD::fgkNameHistoPedestals = "hpedestal";
19 const TString AliITSPreprocessorSDD::fgkNameHistoNoise = "hnoise";
20 ClassImp(AliITSPreprocessorSDD)
23 UInt_t AliITSPreprocessorSDD::Process(TMap*/* dcsAliasMap*/){
28 const char* filename = GetFile(kDAQ,"PEDESTALS","GDC");
29 const char* filenamen= GetFile(kDAQ,"NOISE","GDC");
30 const char* filenamed= GetFile(kDAQ,"DEADCHANNELS","GDC");
31 TFile* f1 = TFile::Open(filename,"r");
32 TFile* f2 = TFile::Open(filenamen,"r");
34 Char_t namehisto2[20];
36 FILE* filed = fopen(filenamed,"read");
37 Int_t numOfBadChannels[fgkNumberOfSDD];
38 Int_t** badCh = new Int_t*[fgkNumberOfSDD];
45 sprintf(str,"MODULE=%d",0);
47 fscanf(filed,"%s\n",row);
48 if(strcmp(row,str)==0){
49 fscanf(filed,"%s %d\n",dims,&dim);
50 badCh[nSDD] = new Int_t[dim];
51 numOfBadChannels[nSDD]=dim;
52 for(Int_t ibad=0;ibad<dim;ibad++){
53 fscanf(filed,"%d\n",&badCh[nSDD][ibad]);
57 sprintf(str,"MODULE=%d",nSDD);
62 AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object
63 md1->SetObjectClassName("AliITSCalibration");
64 md1->SetResponsible("Elisabetta Crescio");
65 md1->SetBeamPeriod(0);
66 md1->SetAliRootVersion("head September 2005"); //root version
67 md1->SetComment("This is a test");
69 TObjArray respSDD(260);
70 respSDD.SetOwner(kFALSE);
72 for(Int_t imod=0;imod<fgkNumberOfSDD;imod++){
73 AliITSCalibrationSDD *cal = new AliITSCalibrationSDD("simulated");
74 cal->SetDeadChannels(numOfBadChannels[imod]);
75 for(Int_t ich=0;ich<numOfBadChannels[imod];ich++){
76 cal->SetBadChannel(ich,badCh[imod][ich]);
78 sprintf(namehisto,"%s_%d",fgkNameHistoPedestals.Data(),imod);
79 sprintf(namehisto2,"%s_%d",fgkNameHistoNoise.Data(),imod);
80 TH1F* hbas = (TH1F*)f1->Get(namehisto);
81 TH1F* hnoi = (TH1F*)f2->Get(namehisto2);
82 for(Int_t ien=0;ien<fgkNumberOfChannels;ien++){
83 cal->SetBaseline(ien,hbas->GetBinContent(ien+1));
84 cal->SetNoiseAfterElectronics(ien,hnoi->GetBinContent(ien+1));
89 result = Store("Calib","Data",&respSDD,md1);
91 for(Int_t i=0;i<fgkNumberOfSDD;i++){