]>
Commit | Line | Data |
---|---|---|
7ca4655f | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
b15de2d2 | 18 | /////////////////////////////////////////////// |
19 | // Author: Henrik Tydesjo // | |
20 | // Preprocessor Class for the SPD // | |
21 | // // | |
22 | /////////////////////////////////////////////// | |
3f0e013c | 23 | |
7ca4655f | 24 | #include <TList.h> |
25 | #include <TObjString.h> | |
26 | #include <TTimeStamp.h> | |
27 | ||
3f0e013c | 28 | #include "AliITSPreprocessorSPD.h" |
b15de2d2 | 29 | #include "AliITSCalibrationSPD.h" |
30 | #include "AliITSOnlineCalibrationSPD.h" | |
31 | #include "AliITSOnlineCalibrationSPDhandler.h" | |
32 | #include "AliCDBMetaData.h" | |
33 | #include "AliLog.h" | |
3f0e013c | 34 | |
b15de2d2 | 35 | ClassImp(AliITSPreprocessorSPD) |
3f0e013c | 36 | |
b15de2d2 | 37 | //______________________________________________________________________________________________ |
38 | AliITSPreprocessorSPD::AliITSPreprocessorSPD(AliShuttleInterface* shuttle) : | |
39 | AliPreprocessor("SPD", shuttle) | |
3f0e013c | 40 | { |
b15de2d2 | 41 | // constructor |
3f0e013c | 42 | } |
43 | ||
b15de2d2 | 44 | //______________________________________________________________________________________________ |
45 | AliITSPreprocessorSPD::~AliITSPreprocessorSPD() | |
3f0e013c | 46 | { |
b15de2d2 | 47 | // destructor |
3f0e013c | 48 | } |
49 | ||
b15de2d2 | 50 | //______________________________________________________________________________________________ |
51 | void AliITSPreprocessorSPD::Initialize(Int_t run, UInt_t startTime, | |
52 | UInt_t endTime) | |
3f0e013c | 53 | { |
b15de2d2 | 54 | // initialize |
55 | AliPreprocessor::Initialize(run, startTime, endTime); | |
3f0e013c | 56 | |
b15de2d2 | 57 | AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run, |
58 | TTimeStamp(startTime).AsString(), | |
59 | TTimeStamp(endTime).AsString())); | |
3f0e013c | 60 | } |
fcf95fc7 | 61 | |
b15de2d2 | 62 | //______________________________________________________________________________________________ |
63 | UInt_t AliITSPreprocessorSPD::Process(TMap* dcsAliasMap) | |
fcf95fc7 | 64 | { |
b15de2d2 | 65 | // Do the actual preprocessing |
fcf95fc7 | 66 | |
b15de2d2 | 67 | // DEAD/NOISY DATA |
68 | // Create the cdb entry, at first filled with empty cal objects (one for each module) | |
69 | TObjArray *spdEntry = new TObjArray(240); | |
70 | for(Int_t module=0;module<240;module++){ | |
71 | AliITSCalibrationSPD* cal = new AliITSCalibrationSPD(); | |
72 | spdEntry->Add(cal); | |
e56160b8 | 73 | } |
b15de2d2 | 74 | spdEntry->SetOwner(kTRUE); |
75 | // Get all the files corresponding to the different modules and fill the dead/noisy lists | |
76 | AliITSOnlineCalibrationSPDhandler* handler = new AliITSOnlineCalibrationSPDhandler(); | |
77 | for (Int_t module=0; module<240; module++) { | |
78 | Char_t id[20]; | |
79 | sprintf(id,"SPD_%d",module); | |
80 | TList* list = GetFileSources(kDAQ,id); // (the id is actually unique, so always 1 file) | |
81 | if (list) { | |
82 | TObjString* fileNameEntry = (TObjString*) list->First(); | |
83 | Char_t* fileName = (Char_t*) GetFile(kDAQ, id, fileNameEntry->GetString().Data()); | |
84 | handler->SetModuleNr(module); | |
85 | handler->ReadFromFile(fileName); | |
86 | ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetNrDead( handler->GetNrDead() ); | |
87 | ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetDeadList( handler->GetDeadArray() ); | |
88 | ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetNrNoisy( handler->GetNrNoisy() ); | |
89 | ((AliITSCalibrationSPD*) spdEntry->At(module)) -> SetNoisyList( handler->GetNoisyArray() ); | |
5bfe44ce | 90 | } |
fcf95fc7 | 91 | } |
b15de2d2 | 92 | delete handler; |
93 | // Store the cdb entry | |
94 | AliCDBMetaData metaData; | |
95 | metaData.SetBeamPeriod(0); | |
96 | metaData.SetResponsible("Henrik Tydesjo"); | |
97 | metaData.SetComment("Preprocessor test for SPD."); | |
98 | UInt_t result = Store("SHUTTLE", "Calib", spdEntry, &metaData, 0, 0); | |
99 | delete spdEntry; | |
e56160b8 | 100 | |
b15de2d2 | 101 | // // REFERENCE DATA |
102 | // // Store the container files as reference data (one for each equipment) | |
103 | // for (UInt_t eq=0; eq<20; eq++) { | |
104 | // Char_t id[20]; | |
105 | // sprintf(id,"SPDref%d",eq); | |
106 | // TList* list = GetFileSources(kDAQ,id); // (the id is actually unique, so always 1 file) | |
107 | // if (list) { | |
108 | // TObjString* fileNameEntry = (TObjString*) list->First(); | |
109 | // Char_t* fileName = (Char_t*) GetFile(kDAQ, id, fileNameEntry->GetString().Data()); | |
110 | // AliITSOnlineSPDscan *scan = new AliITSOnlineSPDscan((Char_t*)fileName); | |
111 | // TObjArray* arr = scan->GetAsTObjArray(); | |
112 | // Char_t refCAT[10]; | |
113 | // sprintf(refCAT,"Ref%d",eq); | |
114 | // StoreReferenceData("SHUTTLE", refCAT, arr, &metaData, 0, 0); | |
115 | // } | |
116 | // } | |
117 | ||
118 | return result; | |
fcf95fc7 | 119 | } |
b15de2d2 | 120 |