#ifndef __CINT__ #include "TFile.h" #include "TString.h" #include "TH1.h" #include "Riostream.h" #include "TGeoManager.h" #include "AliCDBManager.h" #include "AliRawReaderRoot.h" #include "AliGeomManager.h" #include "RAW/AliRawEventHeaderBase.h" #include "ITS/AliITSgeomTGeo.h" #include "ITS/AliITSRawStreamSSD.h" #endif void SSDRawNoiseMap(Char_t *rdfname="/data/local_rec/r55633/08000055633013.10.root", Int_t maxEvent=1100) { // Read raw data file and set initial and configuration parameters AliCDBManager * man = AliCDBManager::Instance(); man->SetDefaultStorage("local://$ALICE_ROOT"); man->SetRun(47508); if(!gGeoManager){ AliGeomManager::LoadGeometry(); } const Int_t moduleOffset = 500; const Int_t nModules = 3000; TH1F *fModuleHists[nModules]; for (Int_t iMod = 0; iMod < nModules; iMod++) { fModuleHists[iMod]=0; } Int_t equipid, eqind, prequipid; Int_t runId = 0; AliRawReaderRoot *rawreader = new AliRawReaderRoot(rdfname, 0); TFile *fout = new TFile("SSD_mod_occ.root","RECREATE"); TH1F *hModuleID = new TH1F("hModuleID","hModuleID;ID",3000,0,3000); if (!(rawreader->GetAttributes() || rawreader->GetEventId())) { printf("AliITSHandleDaSSD: Error reading raw data file %s by Rawreader", rdfname); return; } if (rawreader->NextEvent()) { runId = rawreader->GetRunNumber(); rawreader->RewindEvents(); } else { return; } cout << "Run " << runId << endl; rawreader->Select("ITSSSD"); AliITSRawStreamSSD *stream = new AliITSRawStreamSSD(rawreader); stream->Setv11HybridDDLMapping(); Int_t iEvent = 0; while (rawreader->NextEvent() && iEvent < maxEvent) { if ((rawreader->GetType() != AliRawEventHeaderBase::kPhysicsEvent) && (rawreader->GetType() != AliRawEventHeaderBase::kCalibrationEvent)) continue; if (iEvent%50 == 0) cout << "Event " << iEvent << endl; prequipid = -1; eqind = -1; while (stream->Next()) { equipid = rawreader->GetEquipmentId(); Int_t ddl=stream->GetDDL(); Int_t ad=stream->GetAD(); Int_t adc = stream->GetADC(); adc = (adc<6)? adc : adc - 2; Int_t strip = stream->GetStrip(); if(stream->GetSideFlag()) strip=1535-strip; //Int_t signal = stream->GetSignal(); if (ad < 1) cout << "WARNING: ad should be >= 1, it is " << ad << endl; Int_t iimod = (ad - 1) * 12 + adc; // Int_t module = AliITSRawStreamSSD::GetModuleNumber(ddl,iimod); //cout << "equip " << equipid << " DDL " << ddl << endl; //cout << "Module " << iModule << " strip " << strip << " signal " << signal << endl; if (module > 0 && strip < 1536) { //module -1 means uninstrumented channel Int_t iModule = module - moduleOffset; //cout << "iModule " << iModule << endl; if (fModuleHists[iModule]==0) { TString name="modHist"; name += module; TString title = "Hits for mod "; title += module; fModuleHists[iModule] = new TH1F(name,title,1536,0,1536); //cout << "New hist made " << endl; } fModuleHists[iModule]->Fill(strip); hModuleID->Fill(module); } } iEvent++; } fout->Write(); delete stream; delete rawreader; }