From 4c82df4c690fb5eb4c993ec2e78a57eb6a96ccf1 Mon Sep 17 00:00:00 2001 From: masera Date: Tue, 3 Jul 2007 15:57:59 +0000 Subject: [PATCH] New DA for SDD injectors (F.Prino) --- ITS/AliITSOnlineSDDInjectors.cxx | 10 +- ITS/AliITSOnlineSDDInjectors.h | 2 +- ITS/ITSSDDINJda.cxx | 205 +++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+), 3 deletions(-) create mode 100644 ITS/ITSSDDINJda.cxx diff --git a/ITS/AliITSOnlineSDDInjectors.cxx b/ITS/AliITSOnlineSDDInjectors.cxx index 1748abf2e40..e5e95aac128 100644 --- a/ITS/AliITSOnlineSDDInjectors.cxx +++ b/ITS/AliITSOnlineSDDInjectors.cxx @@ -17,6 +17,8 @@ #include #include +/* $Id$ */ + /////////////////////////////////////////////////////////////////// // // // Implementation of the class used for SDD injector analysis // @@ -364,6 +366,7 @@ void AliITSOnlineSDDInjectors::FindCentroids(){ fRMSCentroid[iii][ninj]=0.; fGoodInj[iii][ninj]=0; } + if(fRMSCentroid[iii][ninj]==0) fGoodInj[iii][ninj]=0; } } } @@ -382,11 +385,14 @@ void AliITSOnlineSDDInjectors::PrintCentroids(){ } } //______________________________________________________________________ -void AliITSOnlineSDDInjectors::WriteToASCII(){ +void AliITSOnlineSDDInjectors::WriteToASCII(Int_t evNumb, UInt_t timeStamp, Int_t optAppend){ // Char_t outfilnam[100]; sprintf(outfilnam,"SDDinj_mod%03d_sid%d.data",fModuleId,fSide); - FILE* outf=fopen(outfilnam,"w"); + FILE* outf; + if(optAppend==0) outf=fopen(outfilnam,"w"); + else outf=fopen(outfilnam,"a"); + fprintf(outf,"%d %d ",evNumb,timeStamp); for(Int_t ic=0;ic +#include + +// ROOT includes +#include +#include +#include +#include + +// AliRoot includes +#include "AliRawReaderDate.h" +#include "AliITSOnlineSDDInjectors.h" +#include "AliITSRawStreamSDD.h" +/* Main routine + Arguments: list of DATE raw data files +*/ +int main(int argc, char **argv) { + + int status = 0; + + + /* log start of process */ + printf("ITS SDD INJ algorithm program started\n"); + + + /* check that we got some arguments = list of files */ + if (argc<2) { + printf("Wrong number of arguments\n"); + return -1; + } + + + Int_t maxNEvents=10; // maximum number of events to be analyzed + const Int_t nSDDmodules=12; // temp for test raw data + AliITSOnlineSDDInjectors **injan=new AliITSOnlineSDDInjectors*[2*nSDDmodules]; + TH2F **histo=new TH2F*[2*nSDDmodules]; + Int_t nWrittenEv[2*nSDDmodules]; + + Char_t hisnam[20]; + for(Int_t imod=0; imodmaxNEvents) break; + + /* use event - here, just write event id to result file */ + eventT=event->eventType; + switch (event->eventType){ + + /* START OF RUN */ + case START_OF_RUN: + break; + + /* END OF RUN */ + case END_OF_RUN: + break; + + // case PHYSICS_EVENT: // comment this line for test raw data + // break; // comment this line for test raw data + + case CALIBRATION_EVENT: + break; // uncomment this line for test raw data + case PHYSICS_EVENT: // uncomment this line for test raw data + printf(" event number = %i \n",iev); + AliRawReader *rawReader = new AliRawReaderDate((void*)event); + rawReader->RequireHeader(kFALSE); + rawReader->SelectEquipment(17,101,101); // temp for test raw data + + Int_t evtyp=0; + while(rawReader->ReadHeader()){ + const UInt_t *subev = rawReader->GetSubEventAttributes(); + if(subev[0]==0 && subev[1]==0 && subev[2]==0) evtyp=1; + } + + rawReader->Reset(); + for(Int_t imod=0; imodReset(); + } + } + AliITSRawStreamSDD s(rawReader); + rawReader->SelectEquipment(17,101,101); // temp for test raw data + + while(s.Next()){ + Int_t iddl=rawReader->GetDDLID(); + iddl=0; // temporary for test raw data + Int_t isddmod=s.GetModuleNumber(iddl,s.GetCarlosId()); + isddmod-=240; // to have SDD modules from 0 to 259 + isddmod=s.GetCarlosId(); // temporary for test raw data + if(isddmodFill(s.GetCoord2(),s.GetCoord1(),s.GetSignal()); + } + } + delete rawReader; + // UInt_t timeSt=rawReader->GetTimestamp(); + UInt_t timeSt=iev*5000+12; // fake timestamp for test + for(Int_t imod=0; imodReset(); + injan[index]->AnalyzeEvent(histo[index]); + injan[index]->WriteToASCII(iev,timeSt,nWrittenEv[index]); + nWrittenEv[index]++; + } + } + + /* free resources */ + free(event); + } + } + + } + + Char_t filnam[100],command[120]; + for(Int_t imod=0; imodExec(command); + } + } + + /* write report */ + printf("Run #%s, received %d injector events\n",getenv("DATE_RUN_NUMBER"),iev); + + /* report progress */ + daqDA_progressReport(90); + + + status=daqDA_FES_storeFile("./SDDinj_LDC1.tar","SDD_Calib"); + + /* report progress */ + daqDA_progressReport(100); + + + + return status; +} -- 2.43.0