/************************************************************************* * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /////////////////////////////////////////////////////////////////////////// // Dielectron Correction framework manager // // // /* */ // // /////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include "AliDielectronCF.h" #include "AliDielectronMC.h" ClassImp(AliDielectronCF) AliDielectronCF::AliDielectronCF() : TNamed("DielectronCF","DielectronCF"), fNSteps(0), fNVars(0), fNCuts(0), fStepsForEachCut(kTRUE), fStepsForCutsIncreasing(kFALSE), fNStepMasks(0), fPdgMother(-1), fCfContainer(0x0) { // // Default constructor // for (Int_t i=0; iGetEntries(); fNSteps=4; //defaults: 0: MC truth // 1: no Cuts + MC // 2: after all cuts // 3: after all cuts + MC truth if (fStepsForEachCut) fNSteps+=(2*fNCuts); //one step for each cut + MC truth if (fStepsForCutsIncreasing) fNSteps+=(2*(fNCuts-2)); //one step for the increasing cuts + MC truth // e.g. cut2&cut3, cut2&cut3&cut4 fNSteps+=(2*fNStepMasks); // cuts for the additional cut masks // create the container fCfContainer = new AliCFContainer(GetName(), GetTitle(), fNSteps, fNVars, fNBins); // initialize the variables and their bin limits for (Int_t iVar=0; iVarSetBinLimits(iVar, binLim); fCfContainer->SetVarTitle(iVar, AliDielectronVarManager::GetValueName(type)); delete binLim; } //=================// // Set step titles // //=================// Int_t step=0; //Pure MC truth fCfContainer->SetStepTitle(step++,"MC truth"); //before cuts (MC truth) fCfContainer->SetStepTitle(step++,"No cuts (MC truth)"); //After All cuts TString cutName="All Cuts"; //TODO: User GetTitle??? fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut cutName+=" (MC truth)"; fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut with MC truth //Steps for each of the cuts if (fStepsForEachCut){ for (Int_t iCut=0; iCutAt(iCut)->GetName(); //TODO: User GetTitle??? fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut cutName+=" (MC truth)"; fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut with MC truth } } //Steps for increasing cut match if (fStepsForCutsIncreasing){ TString cutName=filter.GetCuts()->At(0)->GetName(); //TODO: User GetTitle??? for (Int_t iCut=1; iCutAt(iCut)->GetName(); fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut cutName+=" (MC truth)"; fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut with MC truth } } //Steps of user defined cut combinations for (UInt_t iComb=0; iCombAt(iCut)->GetName(); }else{ cutName+="&"; cutName+=filter.GetCuts()->At(iCut)->GetName(); } } } fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut cutName+=" (MC truth)"; fCfContainer->SetStepTitle(step++, cutName.Data()); //Step for the cut with MC truth } if (step!=fNSteps) { AliError("Something went wrong in the naming of the steps!!!"); } } //________________________________________________________________ void AliDielectronCF::Fill(UInt_t mask, const TObject *particle) { // // Fill the containers // Bool_t isMCTruth=kFALSE; if (fPdgMother>=0) isMCTruth=AliDielectronMC::Instance()->IsMotherPdg(particle,fPdgMother); Double_t valuesAll[AliDielectronVarManager::kNMaxValues]; AliDielectronVarManager::Fill(particle,valuesAll); Double_t values[AliDielectronVarManager::kNMaxValues]; for (Int_t iVar=0; iVarFill(values,step); ++step; //All cuts, if (mask == selectedMask){ fCfContainer->Fill(values,step); ++step; if (isMCTruth) fCfContainer->Fill(values,step); ++step; } else { step+=2; } //Steps for each of the cuts if (fStepsForEachCut){ for (Int_t iCut=0; iCutFill(values,step); ++step; if (isMCTruth) fCfContainer->Fill(values,step); ++step; } else { step+=2; } } } //Steps for increasing cut match if (fStepsForCutsIncreasing){ for (Int_t iCut=1; iCutFill(values,step); ++step; if (isMCTruth) fCfContainer->Fill(values,step); ++step; } else { step+=2; } } } //Steps of user defined cut combinations for (UInt_t iComb=0; iCombFill(values,step); ++step; if (isMCTruth) fCfContainer->Fill(values,step); ++step; } else { step+=2; } } } //________________________________________________________________ void AliDielectronCF::FillMC(const TObject *particle) { // // fill MC part of the Container // Double_t valuesAll[AliDielectronVarManager::kNMaxValues]; AliDielectronVarManager::Fill(particle,valuesAll); Double_t values[AliDielectronVarManager::kNMaxValues]; for (Int_t iVar=0; iVarFill(values,0); }