fNManuConfig(0),
fConfig(1),
fStatusDA(0),
+fHistos(0),
fErrorBuspatchTable(new AliMUON2DMap(kFALSE)),
fManuBuspatchTable(new AliMUON2DMap(kFALSE)),
fManuBPoutofconfigTable(new AliMUON2DMap(kFALSE)),
fPedestalStore(new AliMUON2DMap(kTRUE)),
fIndex(-1),
fPrefixDA(),
-fPrefixLDC()
+fPrefixLDC(),
+fHistoFile(0),
+fTree(0)
{
/// Default constructor
}
fNManuConfig(0),
fConfig(1),
fStatusDA(0),
+fHistos(0),
fErrorBuspatchTable(0),
fManuBuspatchTable(0),
fManuBPoutofconfigTable(0),
fPedestalStore(0),
fIndex(-1),
fPrefixDA(),
-fPrefixLDC()
+fPrefixLDC(),
+fHistoFile(0),
+fTree(0)
{
/// Root IO constructor
}
//______________________________________________________________________________
void AliMUONPedestal::MakePed(Int_t busPatchId, Int_t manuId, Int_t channelId, Int_t charge)
{
+ static Int_t tree_charge=0;
static Int_t warn=0;
+ Int_t DDL= busPatchId/100+2560;
/// Compute pedestals values
AliMUONVCalibParam* ped =
static_cast<AliMUONVCalibParam*>(fPedestalStore ->FindObject(busPatchId, manuId));
+
+ if(!tree_charge && fHistos==2)
+ {
+ fTree = new TTree("tc","Charge tree");
+ fTree->Branch("bp",&busPatchId,"bp/I");
+ fTree->Branch("manu",&manuId,",manu/I");
+ fTree->Branch("channel",&channelId,",channel/I");
+ fTree->Branch("DDL",&DDL,",DDL/I");
+ fTree->Branch("charge",&charge,"charge/I");
+ // fTree->Branch("Pedestal",&Pedestal,"Pedestal/D");
+ // fTree->Branch("chargetrue",&chargeminusPed,"chargetrue/D");
+ // fTree->Branch("evt",&evt,"evt/I");
+ tree_charge=1;
+ }
+
+
if (!ped)
{
if(fConfig)
}
if (ped->ValueAsDouble(channelId, 1) == -1) ped->SetValueAsDouble(channelId, 1, 0.);
+ if(fHistos==2) fTree->Fill();
+
Double_t pedMean = ped->ValueAsDouble(channelId, 0) + (Double_t) charge;
Double_t pedSigma = ped->ValueAsDouble(channelId, 1) + (Double_t) charge*charge;
}
}
+//______________________________________________________________________________
+void AliMUONPedestal::CreateControlHistos()
+{
+// Create histo
+ fHistoFileName=Form("%s.root",fPrefixDA.Data());
+ fHistoFile = new TFile(fHistoFileName,"RECREATE","MUON Tracking pedestals");
+}
//______________________________________________________________________________
void AliMUONPedestal::MakeControlHistos()
{
Int_t busPatchId;
Int_t manuId;
Int_t channelId;
+ Int_t DDL;
// histo
- TFile* histoFile = 0;
+// TFile* histoFile = 0;
TTree* tree = 0;
TH1F* pedMeanHisto = 0;
TH1F* pedSigmaHisto = 0;
- fHistoFileName=Form("%s.root",fPrefixDA.Data());
- histoFile = new TFile(fHistoFileName,"RECREATE","MUON Tracking pedestals");
+ // fHistoFileName=Form("%s.root",fPrefixDA.Data());
+ // histoFile = new TFile(fHistoFileName,"RECREATE","MUON Tracking pedestals");
Int_t nx = ADCMax()+1;
Int_t xmin = 0;
Int_t xmax = ADCMax();
pedMeanHisto = new TH1F("pedmean_allch","Pedestal mean all channels",nx,xmin,xmax);
- pedMeanHisto->SetDirectory(histoFile);
+ pedMeanHisto->SetDirectory(fHistoFile);
nx = 201;
xmin = 0;
xmax = 200;
pedSigmaHisto = new TH1F("pedsigma_allch","Pedestal sigma all channels",nx,xmin,xmax);
- pedSigmaHisto->SetDirectory(histoFile);
+ pedSigmaHisto->SetDirectory(fHistoFile);
tree = new TTree("t","Pedestal tree");
+ tree->Branch("DDL",&DDL,",DDL/I");
tree->Branch("bp",&busPatchId,"bp/I");
tree->Branch("manu",&manuId,",manu/I");
tree->Branch("channel",&channelId,",channel/I");
{
busPatchId = ped->ID0();
manuId = ped->ID1();
+ DDL= busPatchId/100+2560;
for ( channelId = 0; channelId < ped->Size(); ++channelId )
{
}
}
- histoFile->Write();
- histoFile->Close();
+ fHistoFile->Write();
+ fHistoFile->Close();
}
class AliMUONVStore;
class TTimeStamp;
+class TTree;
+class TFile;
using std::ofstream;
using std::ostream;
/// set config flag
void SetconfigDA(Int_t ind) {fConfig = ind;}
- /// set Nb of evt threshold to calculate pedestal
+ /// set Histos flag
+ void SetHistos(Int_t ind) {fHistos = ind;}
+ /// set Nb of evt threshold to calculate pedestal
void SetnEvthreshold(Int_t ind) {fNEvthreshold = ind;}
/// set DA status (return code)
void SetStatusDA(Int_t ind) {fStatusDA = ind;}
void Finalize();
/// Create String to be put into file or AMORE DB
void MakeASCIIoutput(ostream& out) const;
+ /// Create Histograms
+ void CreateControlHistos();
/// Fill Histograms
void MakeControlHistos();
Int_t fNManuConfig; ///< Nb of Manu in the current detector configuration
Int_t fConfig; ///< flag 1(0) for reading(or not) configuration ascii file
Int_t fStatusDA; ///< DA return code (0=OK)
+ Int_t fHistos; ///< flag for Histograms (0,1=standard, 2=ntuple with charge)
AliMUONVStore* fErrorBuspatchTable; ///< Table for buspatches with parity errors
AliMUONVStore* fManuBuspatchTable; ///< Occupancy rate for each (buspatch, manu)
AliMUONVStore* fManuBPoutofconfigTable; ///< (buspatch, manu) out of config
Int_t fIndex; ///< calibration run index
TString fPrefixDA; ///< specific DA prefixname
TString fPrefixLDC; ///< specific LDC prefixname
+ TFile* fHistoFile; ///< .root histo file
+ TTree* fTree ; ///< charge Tree
static const Int_t fgkADCMax; ///< max channel count
/// Not implemented
AliMUONPedestal& operator = (const AliMUONPedestal& rhs);
- ClassDef(AliMUONPedestal,5) // Pedestal computing for DA
+ ClassDef(AliMUONPedestal,6) // Pedestal computing for DA
};
#endif
/*
-------------------------------------------------------------------------
- 2012-02-16 New version: MUONTRKPEDda.cxx,v 1.8
+ 2012-11-23 New version: MUONTRKPEDda.cxx,v 1.9
-------------------------------------------------------------------------
Version for MUONTRKPEDda MUON tracking
filein >> line >> nConfig ; cout << "mutrkpedvalues: " << line << nConfig << " " ;
filein >> line >> nEvthres ; if(nEvthres !=0)nEvthreshold=nEvthres; cout << line << nEvthreshold << " " ;
filein >> line >> checkTokenlost ; cout << line << checkTokenlost << " " ;
- filein >> line >> flag_histo ; if(flag_histo !=0) cout << line << flag_histo << " " ;
+ filein >> line >> flag_histo ; cout << line << flag_histo << " " ; // =0 , 1-> standard , 2-> ntuple charge
filein >> line >> maxEvts ; if(maxEvts!=0){maxEvents=maxEvts; cout << line << maxEvents;}
// filein >> line >> errorDetail ; cout << line << errorDetail << " " ;
// filein >> line >> nSorting ; cout << line << nSorting << " " ;
muonPedestal->SetconfigDA(nConfig);
muonPedestal->SetnEvthreshold(nEvthreshold);
muonPedestal->SetnSorting(nSorting);
+ muonPedestal->SetHistos(flag_histo);
// nConfig=1: configuration ascii file config_$DATE_ROLE_NAME read from DetDB
if(nConfig)
muonPedestal->LoadConfig(dbfile);
}
+ if(flag_histo)muonPedestal->CreateControlHistos(); /// Generate pedestal histo rootfile
+
// Rawdeader, RawStreamHP
AliRawReader* rawReader = AliRawReader::Create(inputFile);
AliMUONRawStreamTrackerHP* rawStream = new AliMUONRawStreamTrackerHP(rawReader);
status1 = daqDA_FES_storeFile(shuttleFile.Data(),"PEDESTALS");
if (status1) { detail=Form("%s: !!! ERROR: Failed to export pedestal file : %s to FES \n",prefixLDC,shuttleFile.Data());
printf("%s",detail); filcout << detail ; status= -1; }
- //else { detail=Form("%s : ***** STORE Pedestal FILE in FES : OK ****** \n",prefixLDC); printf("%s",detail); filcout << detail ;}
// Transferring configuration file to FES (be sure that env variable DAQDALIB_PATH is set)
if(nConfig)
status1 = daqDA_FES_storeFile(dbfile,"CONFIG");
if (status1) { detail=Form("%s: !!! ERROR: Failed to export configuration file : %s to FES \n",prefixLDC,dbfile);
printf("%s",detail); filcout << detail ; status=-1; }
- // else {detail=Form("%s : ***** STORE Configuration FILE in FES : OK ****** \n",prefixLDC); printf("%s",detail); filcout << detail ;}
}
+ filcout.close();
+
// Copying files to local DB folder defined by DAQ_DETDB_LOCAL
Char_t *dir;
unsigned int nLastVersions=50;
dir= getenv("DAQ_DETDB_LOCAL");
if(dir != NULL) {
- unsigned int nLastVersions=50;
+ // unsigned int nLastVersions=50;
printf("\n%s : --- Local DataBase: %s (Max= %d) ---\n",prefixLDC,dir,nLastVersions);
if(!shuttleFile.IsNull())status1 = daqDA_localDB_storeFile(shuttleFile.Data(),nLastVersions);
if(flag_histo)status1 = daqDA_localDB_storeFile(muonPedestal->GetHistoFileName(),nLastVersions);
status1 = daqDA_localDB_storeFile(logOutputFile.Data(),nLastVersions);
}
-
cout << " " << endl;
#ifdef ALI_AMORE
cout << prefixLDC << " : Warning: MCH DA not compiled with AMORE support" << endl;
#endif
- filcout.close();
if(!status)printf("\n%s : -------- End execution : %s -------- (status= %d) \n",prefixLDC,prefixDA,status);
else { printf("\n%s : -------- %s ending in ERROR !!!! -------- (status= %d) \n",prefixLDC,prefixDA,status);}