X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FAliTPCDigitizer.cxx;h=2ff41a12abc97e7fdfa2d89b7522670b8eaeeeaf;hb=156549ae6da2e4509332c1fad57a43b9c4c0164c;hp=b5aada7be3d127b09588f6a4e19a5e38b9cf6c79;hpb=5033a39a7268b4da784b8abbfd1bb69035a0f993;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/AliTPCDigitizer.cxx b/TPC/AliTPCDigitizer.cxx index b5aada7be3d..2ff41a12abc 100644 --- a/TPC/AliTPCDigitizer.cxx +++ b/TPC/AliTPCDigitizer.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include "AliTPCDigitizer.h" @@ -106,7 +107,7 @@ void AliTPCDigitizer::ExecFast(Option_t* option) char s[100]; char ss[100]; TString optionString = option; - if (optionString.Data() == "deb") { + if (!strcmp(optionString.Data(),"deb")) { cout<<"AliTPCDigitizer::Exec: called with option deb "<GenerNoise(500000); //create teble with noise + pTPC->GenerNoise(500000); //create table with noise // Int_t nInputs = fManager->GetNinputs(); Int_t * masks = new Int_t[nInputs]; for (Int_t i=0; iGetMask(i); Short_t **pdig= new Short_t*[nInputs]; //pointers to the expanded digits array - Int_t **ptr= new Int_t*[nInputs]; //pointers to teh expanded tracks array + Int_t **ptr= new Int_t*[nInputs]; //pointers to the expanded tracks array Bool_t *active= new Bool_t[nInputs]; //flag for active input segments - + Char_t phname[100]; //create digits array for given sectors // make indexes - + // + //create branch's in TPC treeD + orl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); + ogime = orl->GetLoader("TPCLoader"); + TTree * tree = ogime->TreeD(); + AliSimDigits * digrow = new AliSimDigits; + + if (tree == 0x0) + { + ogime->MakeTree("D"); + tree = ogime->TreeD(); + } + tree->Branch("Segment","AliSimDigits",&digrow); + // AliSimDigits ** digarr = new AliSimDigits*[nInputs]; for (Int_t i1=0;i1 *ph = (TParameter*)treear->GetUserInfo() + ->FindObject("lhcphase0"); + if(!ph){ + cerr<<"AliTPCDigitizer: LHC phase not found in" + <<" input "<< i1<GetUserInfo()->Add(new TParameter(phname,ph->GetVal())); + // if (treear->GetIndex()==0) treear->BuildIndex("fSegmentID","fSegmentID"); treear->GetBranch("Segment")->SetAddress(&digarr[i1]); } - //create branch's in TPC treeD - AliSimDigits * digrow = new AliSimDigits; - orl = AliRunLoader::GetRunLoader(fManager->GetOutputFolderName()); - ogime = orl->GetLoader("TPCLoader"); - - TTree * tree = ogime->TreeD(); - if (tree == 0x0) - { - ogime->MakeTree("D"); - tree = ogime->TreeD(); - } - tree->Branch("Segment","AliSimDigits",&digrow); + // param->SetZeroSup(2); @@ -311,7 +341,11 @@ void AliTPCDigitizer::ExecFast(Option_t* option) pdig1++; ptr1++; } - + // + // glitch filter + // + digrow->GlitchFilter(); + // digrow->CompresBuffer(1,zerosup); digrow->CompresTrackBuffer(1); tree->Fill(); @@ -344,7 +378,7 @@ void AliTPCDigitizer::ExecSave(Option_t* option) //output stored in TreeTPCD TString optionString = option; - if (optionString.Data() == "deb") { + if (!strcmp(optionString.Data(),"deb")) { cout<<"AliTPCDigitizer::Exec: called with option deb "<GetLoader("TPCLoader"); rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); - gime = rl->GetLoader("TPCLoader"); - + //gime = rl->GetLoader("TPCLoader"); + rl->GetLoader("TPCLoader"); rl->LoadgAlice(); AliRun* alirun = rl->GetAliRun(); @@ -368,26 +402,37 @@ void AliTPCDigitizer::ExecSave(Option_t* option) printf("noise %f \n", param->GetNoise()*param->GetNoiseNormFac()); // Int_t nInputs = fManager->GetNinputs(); + // stupid protection... + if (nInputs <= 0) return; + // Int_t * masks = new Int_t[nInputs]; for (Int_t i=0; iGetMask(i); AliSimDigits ** digarr = new AliSimDigits*[nInputs]; + for(Int_t ii=0;iiGetInputFolderName(i1)); gime = rl->GetLoader("TPCLoader"); TTree * treear = gime->TreeS(); - TBranch * br = treear->GetBranch("fSegmentID"); - if (br) br->GetFile()->cd(); + // if (!treear) { - cerr<<" TPC - not existing input = \n"<GetBranch("fSegmentID"); + if (br) br->GetFile()->cd(); treear->GetBranch("Segment")->SetAddress(&digarr[i1]); - } + } rl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); gime = rl->GetLoader("TPCLoader"); @@ -518,6 +563,6 @@ void AliTPCDigitizer::ExecSave(Option_t* option) delete digrow; for (Int_t i1=0;i1