AliRoot Core  edcc906 (edcc906)
RunAliTPCCalibKrTask.C
Go to the documentation of this file.
1 
87 TChain * chain = 0;
88 
89 void RunAliTPCCalibKrTask(Bool_t bProof = kFALSE)
90 {
92 
93  AliXRDPROOFtoolkit tool;
94  chain = tool.MakeChain("list.txt","Kr","",20000,0);
95  chain->Lookup();
96  chain->SetBranchStatus("Cl.fCluster",kFALSE);
97 
98  //
99  // Create the analysis manager
100  //
101  AliAnalysisManager *mgr = new AliAnalysisManager("testAnalysis");
102 
103  // Calibration component
104  AliTPCCalibKr *calibObj = new AliTPCCalibKr;
105  //calibObj->SetASide(kFALSE);
106 
107  // Add task
108  AliTPCCalibKrTask *task = new AliTPCCalibKrTask;
109  task->SetInputChain(chain);
110  task->SetTPCCalibKr(calibObj);
111  mgr->AddTask(task);
112 
113  // Attach input
114  cInput = mgr->CreateContainer("cInput", TChain::Class(), AliAnalysisManager::kInputContainer);
115  mgr->ConnectInput(task, 0, cInput);
116 
117  // Attach output
118  cOutput = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer,"outHistFile.root");
119  mgr->ConnectOutput(task, 0, cOutput);
120  //
121  cOutput->SetSpecialOutput(kTRUE);
122  cOutput->SetFileName("CalibObjectFile.root");
123  //
124  // Run analysis
125  if (!mgr->InitAnalysis()) return;
126  mgr->PrintStatus();
127  mgr->SetDebugLevel(1);
128 
129  if(bProof) {
130  mgr->StartAnalysis("proof", chain);
131  }
132  else mgr->StartAnalysis("local", chain);
133 }
134 
135 
136 
137 void MakeTree(){
138 
139  TFile fpad("calibKr.root");
141  preprocesor->AddComponent(spectrMean->Clone());
142  preprocesor->AddComponent(spectrRMS->Clone());
143  preprocesor->AddComponent(fitMean->Clone());
144  preprocesor->AddComponent(fitRMS->Clone());
145  preprocesor->AddComponent(fitNormChi2->Clone());
146  preprocesor->AddComponent(entries->Clone());
147  preprocesor->DumpToFile("kryptonTree.root");
148 
149 }
TOOLKIT for chain manipulation:
void MakeTree()
static TChain * MakeChain(const char *fileIn, const char *treeName, const char *fName=0, Int_t maxFiles=-1, Int_t startFile=0, Int_t checkLevel=0)
void RunAliTPCCalibKrTask(Bool_t bProof=kFALSE)
TChain * chain
void DumpToFile(const char *fileName)
Preprocessor class for HLT and DAQ.