Skip to content

Commit

Permalink
New analysis tag v5-04-39-AN
Browse files Browse the repository at this point in the history
  • Loading branch information
morsch committed Mar 14, 2013
2 parents 451b9d6 + 0316981 commit 8f19eb1
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 107 deletions.
11 changes: 4 additions & 7 deletions ANALYSIS/AliAnalysisManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2745,21 +2745,18 @@ void AliAnalysisManager::AddClassDebug(const char *className, Int_t debugLevel)
fDebugOptions->SetOwner(kTRUE);
}

// substracting DebugOffset, beacuse of AliLog::SetClassDebugLevel()
debugLevel -= AliLog::kDebug-1;

TNamed *debugOpt = (TNamed*)fDebugOptions->FindObject(className);
if (!debugOpt) {
AliInfo(TString::Format("Adding debug level %d for class %s",debugLevel+AliLog::kDebug-1,className).Data());
AliInfo(TString::Format("Adding debug level %d for class %s",debugLevel,className).Data());
fDebugOptions->Add(new TNamed(className,TString::Format("%d",debugLevel).Data()));
} else {
TString oldDebugStr = debugOpt->GetTitle();
Int_t oldDebug = oldDebugStr.Atoi();
if (debugLevel > oldDebug) {
AliWarning(TString::Format("Overwriting debug level to %d class %s, because it is higher then previously set (%d).",debugLevel+AliLog::kDebug-1,className,oldDebug+AliLog::kDebug-1).Data());
AliWarning(TString::Format("Overwriting debug level to %d class %s, because it is higher then previously set (%d).",debugLevel,className,oldDebug).Data());
debugOpt->SetTitle(TString::Format("%d",debugLevel).Data());
} else {
AliWarning(TString::Format("Ignoring debug level to %d class %s, because it is smaller then previously set (%d).",debugLevel+AliLog::kDebug-1,className,oldDebug+AliLog::kDebug-1).Data());
AliWarning(TString::Format("Ignoring debug level to %d class %s, because it is smaller then previously set (%d).",debugLevel,className,oldDebug).Data());
}
}
}
Expand All @@ -2776,7 +2773,7 @@ void AliAnalysisManager::ApplyDebugOptions()
TString debugLevel;
while ((debug=dynamic_cast<TNamed*>(next()))) {
debugLevel = debug->GetTitle();
AliInfo(TString::Format("ApplyDebugOptions : Class=%s debulLevel=%d",debug->GetName(),debugLevel.Atoi()+AliLog::kDebug-1).Data());
AliInfo(TString::Format("Class=%s debulLevel=%d",debug->GetName(),debugLevel.Atoi()).Data());
AliLog::SetClassDebugLevel(debug->GetName(), debugLevel.Atoi());
}
}
Expand Down
28 changes: 14 additions & 14 deletions ANALYSIS/AliAnalysisTaskSE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -581,17 +581,17 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
Double_t time = 0;
Int_t mclabel =-1;
Double_t efrac = 0;
if(cellsA->GetMCLabel(i) >= 0 && fgAODEmcalCells->GetMCLabel(i) < 0)
if(cellsA->GetMCLabel(i) >= 0 && fgAODEmcalCells->GetMCLabel(pos) < 0)
{
mclabel = cellsA->GetMCLabel(i) ;
time = fgAODEmcalCells->GetTime(i) ; // Time from data
time = fgAODEmcalCells->GetTime(pos) ; // Time from data
if(amp > 0) efrac = cellsA->GetAmplitude(i) / amp;
}
else if(fgAODEmcalCells->GetMCLabel(i) >= 0 && cellsA->GetMCLabel(i) < 0)
else if(fgAODEmcalCells->GetMCLabel(pos) >= 0 && cellsA->GetMCLabel(i) < 0)
{
mclabel = fgAODEmcalCells->GetMCLabel(i) ;
mclabel = fgAODEmcalCells->GetMCLabel(pos) ;
time = cellsA->GetTime(i) ; // Time from data
if(amp > 0) efrac = fgAODEmcalCells->GetAmplitude(i) / amp;
if(amp > 0) efrac = fgAODEmcalCells->GetAmplitude(pos) / amp;
}
else
{ // take all from input
Expand All @@ -609,9 +609,9 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
Int_t nn = copycells1->GetNumberOfCells();

while( nn-- ){ fgAODEmcalCells->SetCell(nn,copycells1->GetCellNumber(nn),copycells1->GetAmplitude(nn),
copycells1->GetTime(nn),copycells1->GetMCLabel(nn),0.); }
copycells1->GetTime(nn),copycells1->GetMCLabel(nn),copycells1->GetEFraction(nn)); }

fgAODEmcalCells->SetCell(nc++,cn,cellsA->GetAmplitude(i),cellsA->GetTime(i), cellsA->GetMCLabel(i),0.);
fgAODEmcalCells->SetCell(nc++,cn,cellsA->GetAmplitude(i),cellsA->GetTime(i), cellsA->GetMCLabel(i),1.);

delete copycells1;
}
Expand Down Expand Up @@ -651,17 +651,17 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
Double_t time = 0;
Int_t mclabel =-1;
Double_t efrac = 0;
if(cellsP->GetMCLabel(i) >= 0 && fgAODPhosCells->GetMCLabel(i) < 0)
if(cellsP->GetMCLabel(i) >= 0 && fgAODPhosCells->GetMCLabel(pos) < 0)
{
mclabel = cellsP->GetMCLabel(i) ;
time = fgAODPhosCells->GetTime(i) ; // Time from data
time = fgAODPhosCells->GetTime(pos) ; // Time from data
if(amp > 0) efrac = cellsP->GetAmplitude(i) / amp;
}
else if(fgAODPhosCells->GetMCLabel(i) >= 0 && cellsP->GetMCLabel(i) < 0)
else if(fgAODPhosCells->GetMCLabel(pos) >= 0 && cellsP->GetMCLabel(i) < 0)
{
mclabel = fgAODPhosCells->GetMCLabel(i) ;
mclabel = fgAODPhosCells->GetMCLabel(pos) ;
time = cellsP->GetTime(i) ; // Time from data
if(amp > 0) efrac = fgAODPhosCells->GetAmplitude(i) / amp;
if(amp > 0) efrac = fgAODPhosCells->GetAmplitude(pos) / amp;
}
else
{ // take all from input
Expand All @@ -679,9 +679,9 @@ void AliAnalysisTaskSE::Exec(Option_t* option)
Int_t nn = copycells1->GetNumberOfCells();

while( nn-- ){ fgAODPhosCells->SetCell(nn,copycells1->GetCellNumber(nn),copycells1->GetAmplitude(nn),
copycells1->GetTime(nn),copycells1->GetMCLabel(nn),0.); }
copycells1->GetTime(nn),copycells1->GetMCLabel(nn),copycells1->GetEFraction(nn)); }

fgAODPhosCells->SetCell(nc++,cn,cellsP->GetAmplitude(i),cellsP->GetTime(i), cellsP->GetMCLabel(i),0.);
fgAODPhosCells->SetCell(nc++,cn,cellsP->GetAmplitude(i),cellsP->GetTime(i), cellsP->GetMCLabel(i),1.);

delete copycells1;
}
Expand Down
2 changes: 1 addition & 1 deletion ANALYSIS/TenderSupplies/AliEMCALTenderSupply.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ void AliEMCALTenderSupply::FillDigitsArray()

if(fSetCellMCLabelFromCluster) mcLabel = cellLabels[cellNumber];

if (mcLabel > 0 && efrac == 0) efrac = 1;
if (mcLabel > 0 && efrac < 1e-6) efrac = 1;

new((*fDigitsArr)[idigit]) AliEMCALDigit(mcLabel, mcLabel, cellNumber,
(Float_t)cellAmplitude, (Float_t)cellTime,
Expand Down
9 changes: 5 additions & 4 deletions EVGEN/AliGenLcLib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ Double_t AliGenLcLib::PtLcFlat( const Double_t *, const Double_t *)

Double_t AliGenLcLib::PtLcExp( const Double_t *x, const Double_t *)
{
// EXP pt-distribution
return x[0]*TMath::Exp(-x[0]/0.17);
// pt-distribution
//return x[0]*TMath::Exp(-x[0]/0.16); // distribution used in LHC11f1 for the anchor runs : 139441, 139510, 139511, 130513, 130514, 130517.
return TMath::GammaDist(x[0],2,0,1.7); //distribution as in LHC11a10a of the prompt Lc whose daughters are in |eta|<0.9. Used for Lb as well.
}

Double_t AliGenLcLib::YLcFlat(const Double_t */*x*/,const Double_t *)
Double_t AliGenLcLib::YLcFlat(const Double_t *,const Double_t *)
{
//LambdaC y-distribution
return 5;
return 1;
}


Expand Down
131 changes: 121 additions & 10 deletions MUON/CreateWeightedRejectList.C
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
#include <TObject.h>
#include <TTree.h>
#include <vector>
#include "AliCounterCollection.h"

#include "AliMUONTrackerDataWrapper.h"
#include "AliMUONPainterDataRegistry.h"

class RunInfo
{
Expand All @@ -97,21 +101,129 @@ private:

std::ostream& operator<<(std::ostream& out, const RunInfo& run)
{
out << Form("RUN %09d NEVENTS %10d",run.Number(),run.Nevents());
out << Form("RUN %09d NEVENTS %lld",run.Number(),run.Nevents());
return out;
}

AliMUONRejectList* CheckDE_BP_ManuPedestals(Int_t rejectMask, AliMUONPadStatusMaker& status);

Int_t AddEventsSingleRun(Int_t index,
Int_t run_number,
AliMUONRejectList& rejectedEvents);
Int_t AddEventsSingleRun(Int_t run_number, Long64_t nEvents,AliMUONRejectList& rejectedEvents);

std::vector<RunInfo> runs;

//______________________________________________________________________________
AliMUONRejectList* CreateWeightedRejectList(AliCounterCollection& cc,
const char* ocdbPath="local:///Users/laurent/Alice/OCDBcopy2013",
const char* weigthWithTrigger="CMSL7-B-NOPF-MUON")
{
// create the reject using the runs in the collection
//
// the counter collection is expected to have "trigger","event","run" rubrics
// and event:PSALL should be a valid one.
//

if (!gGrid)
{
TGrid::Connect("alien://");
}

AliCDBManager::Instance()->SetDefaultStorage(ocdbPath);

AliMUONRejectList* weightedRejectList = new AliMUONRejectList;

AliMUONRejectList rejectedEvents;

TString sruns = cc.GetKeyWords("run");
TObjArray* truns = sruns.Tokenize(",");

TIter next(truns);
TObjString* s;

Double_t nEventsTotal(0.0);

while ( ( s = static_cast<TObjString*>(next())) )
{
Int_t runNumber = s->String().Atoi();
AliSysInfo::Instance()->AddStamp(Form("RUN%d",runNumber));
Long64_t nEvents = cc.GetSum(Form("trigger:%s/event:PSALL/run:%d",weigthWithTrigger,runNumber));
if (!nEvents)
{
std::cout << "No events for run " << runNumber << " ??" << std::endl;
continue;
}
nEventsTotal += AddEventsSingleRun(runNumber,nEvents,rejectedEvents);
}

delete truns;

AliMpDEIterator DEiter;

for (DEiter.First(); !DEiter.IsDone(); DEiter.Next())
if (DEiter.CurrentDEId() < 1100)
{
Int_t DEid = DEiter.CurrentDEId();

Double_t nBadEventsDE = rejectedEvents.DetectionElementProbability(DEid);
Double_t nEventsTotalDE = static_cast<Double_t>(nEventsTotal);
Float_t probaDE = 0.0;
if (nEventsTotalDE != 0.0)
probaDE = nBadEventsDE / nEventsTotalDE;
weightedRejectList->SetDetectionElementProbability(DEid, probaDE);

Int_t nBusPatches = DEiter.CurrentDE()->GetNofBusPatches();
for (Int_t ii = 0; ii < nBusPatches; ii++)
{
Int_t BPid = DEiter.CurrentDE()->GetBusPatchId(ii);

Double_t nBadEventsBP = rejectedEvents.BusPatchProbability(BPid);
Double_t nEventsTotalBP = nEventsTotalDE - nBadEventsDE;
Float_t probaBP = 0.0;
if (nEventsTotalBP != 0.0)
probaBP = nBadEventsBP / nEventsTotalBP;
weightedRejectList->SetBusPatchProbability(BPid, probaBP);

Int_t nManus = AliMpDDLStore::Instance(kFALSE)->GetBusPatch(BPid, kFALSE)->GetNofManus();
for (Int_t jj = 0; jj < nManus; jj++)
{
Int_t manuId = AliMpDDLStore::Instance(kFALSE)->GetBusPatch(BPid, kFALSE)->GetManuId(jj);

Double_t nBadEventsManu = rejectedEvents.ManuProbability(DEid, manuId);
Double_t nEventsTotalManu = nEventsTotalBP - nBadEventsBP;
Float_t probaManu = 0.0;
if (nEventsTotalManu != 0.0)
probaManu = nBadEventsManu / nEventsTotalManu;
weightedRejectList->SetManuProbability(DEid, manuId, probaManu);

for (Int_t channel = 0; channel < AliMpConstants::ManuNofChannels(); channel++)
{
Double_t nBadEventsChannel = rejectedEvents.ChannelProbability(DEid, manuId, channel);
Double_t nEventsTotalChannel = nEventsTotalManu - nBadEventsManu;
Float_t probaChannel = 0.0;
if (nEventsTotalChannel != 0.0)
{
probaChannel = nBadEventsChannel / nEventsTotalChannel;
}

weightedRejectList->SetChannelProbability(DEid, manuId, channel, probaChannel);
}
}
}
}


AliMUONTrackerData* td = new AliMUONTrackerData("WeightedRejectList","RejectList",*weightedRejectList);

AliMUONVTrackerDataMaker* dw = new AliMUONTrackerDataWrapper(td);

AliMUONPainterDataRegistry::Instance()->Register(dw);

return weightedRejectList;
}

//______________________________________________________________________________
bool CreateWeightedRejectList(const char* runlistfile="runlist.txt",
const char* rejectListPath="local://$HOME/OCDB")
const char* rejectListPath="local://$HOME/OCDB",
const char* author="Matthieu Lenhardt")
{
/// Create a weighted RejectList for the runs included in the run list
/// The cuts are the same that the one applied in the RecoParam used to create the ESDs.
Expand Down Expand Up @@ -158,7 +270,8 @@ bool CreateWeightedRejectList(const char* runlistfile="runlist.txt",
{
Int_t runNumber = runs[ii].Number();
AliSysInfo::Instance()->AddStamp(Form("RUN%d",runNumber));
nEventsTotal += AddEventsSingleRun(ii, runNumber, rejectedEvents);
Long64_t nEvents = runs[ii].Nevents();
nEventsTotal += AddEventsSingleRun(runNumber, nEvents, rejectedEvents);
}

AliMpDEIterator DEiter;
Expand Down Expand Up @@ -219,7 +332,7 @@ bool CreateWeightedRejectList(const char* runlistfile="runlist.txt",
AliMUONCDB::WriteToCDB(&weightedRejectList, "MUON/Calib/RejectList",
firstRun , lastRun,
"Weighted reject List for MCH, for simulations only",
"Matthieu Lenhardt");
author);

return true;
}
Expand Down Expand Up @@ -265,7 +378,7 @@ AliMUONRejectList* CheckDE_BP_ManuPedestals(Int_t rejectMask, AliMUONPadStatusMa


//____________________________________________________________________________________________
Int_t AddEventsSingleRun(Int_t index, Int_t runNumber, AliMUONRejectList& rejectedEvents)
Int_t AddEventsSingleRun(Int_t runNumber, Long64_t nEvents, AliMUONRejectList& rejectedEvents)
{
AliCDBManager::Instance()->SetRun(runNumber);

Expand All @@ -279,8 +392,6 @@ Int_t AddEventsSingleRun(Int_t index, Int_t runNumber, AliMUONRejectList& reject

status.SetLimits(*recoParam);

Long64_t nEvents = runs[index].Nevents();

Int_t rejectMask = recoParam->PadGoodnessMask();

// Functions to compute the number of bad channels at the DE, BP and Manu level
Expand Down
Loading

0 comments on commit 8f19eb1

Please sign in to comment.