///////////////////////////////////////// // Class for SDD digits preprocessing // // // // // //////////////////////////////////////// #include "AliITSPreprocessorSDD.h" #include "AliITSCalibrationSDD.h" #include "AliShuttleInterface.h" #include "AliCDBMetaData.h" #include "TObjArray.h" #include "AliLog.h" #include #include #include const Int_t AliITSPreprocessorSDD::fgkNumberOfSDD = 260; const Int_t AliITSPreprocessorSDD::fgkNumberOfChannels = 512; const Int_t AliITSPreprocessorSDD::fgkNumberOfChannelsPerChip = 64; const TString AliITSPreprocessorSDD::fgkNameHistoPedestals = "hpedestal"; const TString AliITSPreprocessorSDD::fgkNameHistoNoise = "hnoise"; ClassImp(AliITSPreprocessorSDD) UInt_t AliITSPreprocessorSDD::Process(TMap*/* dcsAliasMap*/){ //preprocessing. TObjArray respSDD(fgkNumberOfSDD); respSDD.SetOwner(kFALSE); Float_t baseline,rawnoise,cmn,gain; Int_t isgoodan,i,im,is,isgoodmod; Int_t numOfBadChannels[fgkNumberOfSDD]; //TString pwd = gSystem->pwd(); const Char_t* tempDir=AliShuttleInterface::GetShuttleTempDir(); TList* sourceList = GetFileSources(kDAQ, "SDD_Calib"); if (!sourceList){ Log("Error: no sources found for SDD_Calib"); return 2; } Int_t ind = 0; while (sourceList->At(ind)!=NULL) { TObjString* tarId = (TObjString*) sourceList->At(ind); TString tarName = GetFile(kDAQ, "SDD_Calib", tarId->GetString().Data()); gSystem->cd(tempDir); Char_t command[100]; sprintf(command,"tar -xf %s",tarName.Data()); gSystem->Exec(command); ind++; } delete sourceList; for(Int_t imod=0;imodSetDead(); for(Int_t ian=0;ian<(fgkNumberOfChannels/2);ian++){ fscanf(basFil,"%d %d %f %f %f %f\n",&i,&isgoodan,&baseline,&rawnoise,&cmn,&gain); Int_t ich=ian; if(isid==1) ich+=256; if(!isgoodan){ Int_t ibad=numOfBadChannels[imod]; numOfBadChannels[imod]++; badch[ibad]=ich; } cal->SetBaseline(ich,baseline); cal->SetNoiseAfterElectronics(ich,rawnoise); Int_t iChip=ian/fgkNumberOfChannelsPerChip; Int_t iChInChip=ian%fgkNumberOfChannelsPerChip; cal->SetGain(gain,isid,iChip,iChInChip); } cal->SetDeadChannels(numOfBadChannels[imod]); for(Int_t ibad=0;ibadSetBadChannel(ibad,badch[ibad]); } fclose(basFil); } respSDD.Add(cal); } AliCDBMetaData *md1= new AliCDBMetaData(); // metaData describing the object md1->SetObjectClassName("AliITSCalibration"); md1->SetResponsible("Elisabetta Crescio, Francesco Prino"); md1->SetBeamPeriod(0); md1->SetAliRootVersion("head 5 April 2007"); //root version md1->SetComment("This is a test"); Bool_t retcode = Store("Calib","CalibSDD",&respSDD,md1, 0, kTRUE); if(retcode) return 0; else return 1; }