Skip to content

Commit

Permalink
New analysis tag v5-04-29-AN
Browse files Browse the repository at this point in the history
  • Loading branch information
morsch committed Feb 7, 2013
2 parents 63d1ea5 + 5792ace commit e0e5fd5
Show file tree
Hide file tree
Showing 20 changed files with 568 additions and 369 deletions.
2 changes: 1 addition & 1 deletion ANALYSIS/AliAnalysisTaskPIDResponse.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void AliAnalysisTaskPIDResponse::SetRecoInfo()
fPIDResponse->SetCurrentFile(fileName.Data());
}

if (!(prodInfo.IsMC())) { // reco pass is needed only for data
if ( (prodInfo.IsMC() == kFALSE) || (fIsMC == kFALSE) ) { // reco pass is needed only for data
fRecoPass = prodInfo.GetRecoPass();
if (fRecoPass < 0) { // as last resort we find pass from file name (UGLY, but not stored in ESDs/AODs before LHC12d )
TString fileName(file->GetName());
Expand Down
46 changes: 30 additions & 16 deletions EVE/macros/saveViews.C
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


/*
* This script creates a single picture containing all OpenGL views from a running AliEve
* This script creates a collage containing all OpenGL views from a running AliEve
*
* Considering a given size (width, height) for the final picture, the size for all OpenGL
* Given Collage size (width, height), the size for all OpenGL
* views are computed using the same aspect ratio (width/height) as the main 3D View
*/

Expand All @@ -32,12 +32,13 @@

TString getEventInfo();

/* composite picture final size
/***********Save all OpenGL views into one picture
compositeImgFileName - save final image to this file
width - of the final image
height -of the final image
showLiveBar - whether to show the LIVE bar, useful when not online (using offline)
width - of the collage image
height -of the collage image
*/
void saveViews(const char* compositeImgFileName="views.png", Int_t width = 1440, Int_t height= 900)
void saveViews(const char* compositeImgFileName="views.png", Bool_t showLiveBar=kTRUE, Int_t width = 1440, Int_t height= 900)
{
Info("saveViews.C", "saving views to [%s]", compositeImgFileName);

Expand Down Expand Up @@ -86,10 +87,7 @@ void saveViews(const char* compositeImgFileName="views.png", Int_t width = 1440,
tempImg->CopyArea(compositeImg, 0,0, widthChildView, heightChildView, x,y);

// draw a border around child views
compositeImg->DrawRectangle(x,y, widthChildView, heightChildView);
//compositeImg->FillRectangle("#CFEDF0", x+1,y+1, widthChildView-1, 40);
//compositeImg->DrawText(x+5,y+10, view->GetName(), 28, "#000000", "verdana.ttf", TImage::kOutlineBelow);

compositeImg->DrawRectangle(x,y, widthChildView, heightChildView, "#C0C0C0");
}

/*
Expand All @@ -101,20 +99,33 @@ void saveViews(const char* compositeImgFileName="views.png", Int_t width = 1440,

index++;
}

// Create a glow (bloom) effect
tempImg = (TASImage*)compositeImg->Clone("tempImg");
tempImg->Blur(10.0,10.0);
compositeImg->Merge(tempImg, "lighten");
delete tempImg; tempImg = 0;


// show LIVE bar
if(showLiveBar){
TTimeStamp ts;
TString tNow = ts.AsString("s"); // display date & time

compositeImg->Gradient( 90, "#EAEAEA #D2D2D2 #FFFFFF", 0, 30, 0, 234, 75);
compositeImg->Gradient( 90, "#D6D6D6 #242424 #000000", 0, 35, 40, 224, 30);
compositeImg->Gradient( 90, "#EAEAEA #D2D2D2 #FFFFFF", 0, 75, 0, 239, 95);
compositeImg->Gradient( 90, "#D6D6D6 #242424 #000000", 0, 155, 60, 152, 26);
compositeImg->BeginPaint();
compositeImg->DrawRectangle(30,0, 234, 75);
compositeImg->DrawText(35, 4, "ALICE", 40, "#000000", "FreeSans.otf");
compositeImg->DrawText(162, 6, "LIVE", 40, "#FF2D00", "FreeSansBold.otf");
compositeImg->DrawText(59, 48, tNow, 20, "#FFFFFF", "arial.ttf");
compositeImg->DrawRectangle(50,0, 264, 94);
compositeImg->DrawText(162, 6, "LIVE", 70, "#FF2D00", "FreeSansBold.otf");
compositeImg->DrawText(162, 65, tNow, 16, "#FFFFFF", "arial.ttf");
compositeImg->EndPaint();
//include ALICE Logo
tempImg = new TASImage( Form("%s/picts/2012-Jul-04-4_Color_Logo_small_CB.png", gSystem->Getenv("ALICE_ROOT")) );
tempImg->Scale(64,86);
//tempImg->CopyArea(compositeImg, 0,0, 236, 319, 59, 4);
compositeImg->Merge(tempImg, "alphablend", 82, 4);
delete tempImg; tempImg = 0;
}

// show Information bar
TString stringInfo;
Expand All @@ -134,8 +145,11 @@ void saveViews(const char* compositeImgFileName="views.png", Int_t width = 1440,
return;
}

// This function retrieves a string containing some information regarding the current event
TString getEventInfo()
{
// For general public please show as less or technical information as possible

TString rawInfo, esdInfo;

if (!AliEveEventManager::HasRawReader())
Expand Down
117 changes: 80 additions & 37 deletions ITS/UPGRADE/AliITSU.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ the AliITS class.
#include "AliITSUSegmentationPix.h"
#include "AliITSUSimuParam.h"
#include "AliITSFOSignalsSPD.h"
#include "AliParamList.h"
#include "AliCDBManager.h" // tmp! Later the simuparam should be loaded centrally
#include "AliCDBEntry.h"

ClassImp(AliITSU)

Expand All @@ -117,8 +120,9 @@ AliDetector()
,fModuleHits(0)
,fDetDigits(0)
,fSensMap(0)
,fSimulation(0)
,fSegmentation(0)
,fSimModelLr(0)
,fSegModelLr(0)
,fResponseLr(0)
,fCalibration(0)
,fRunNumber(0)
,fSimInitDone(kFALSE)
Expand All @@ -143,8 +147,9 @@ AliITSU::AliITSU(const Char_t *title, Int_t nlay) :
,fModuleHits(0)
,fDetDigits(0)
,fSensMap(0)
,fSimulation(0)
,fSegmentation(0)
,fSimModelLr(0)
,fSegModelLr(0)
,fResponseLr(0)
,fCalibration(0)
,fRunNumber(0)
,fSimInitDone(kFALSE)
Expand All @@ -164,11 +169,25 @@ AliITSU::~AliITSU()
// Default destructor for ITS.
//
delete fHits;
delete fSimuParam;
// delete fSimuParam; // provided by the CDBManager
delete fSensMap;
if (fSimulation) fSimulation->Delete();
delete fSimulation;
delete fSegmentation;
if (fSimModelLr) {
for (int i=fNLayers;i--;) { // different layers may use the same simulation model
for (int j=i;j--;) if (fSimModelLr[j]==fSimModelLr[i]) fSimModelLr[j] = 0;
delete fSimModelLr[i];
}
delete[] fSimModelLr;
}
if (fSegModelLr) {
for (int i=fNLayers;i--;) { // different layers may use the same simulation model
for (int j=i;j--;) if (fSegModelLr[j]==fSegModelLr[i]) fSegModelLr[j] = 0;
delete fSegModelLr[i];
}
delete[] fSegModelLr;
}
//
delete fResponseLr; // note: the response data is owned by the CDBManager, we don't delete them
//
delete[] fLayerName; // Array of TStrings
delete[] fIdSens;
//
Expand Down Expand Up @@ -486,11 +505,12 @@ void AliITSU::Hits2SDigits(Int_t evNumber,Int_t bgrev,Option_t *option,const cha
FillModules(bgrev,option,filename);
//
Int_t nmodules = fGeomTGeo->GetNModules();

for(int module=0;module<nmodules;module++) {
int id = fGeomTGeo->GetModuleDetTypeID(module);
AliITSUSimulation* sim = GetSimulationModel(id);
if (!sim) AliFatal(Form("The sim.class for module %d of DetTypeID %d is missing",module,id));
sim->SDigitiseModule( GetModule(module), module, evNumber, GetSegmentation(id));
int lr = fGeomTGeo->GetLayer(module);
AliITSUSimulation* sim = GetSimulationModel(lr);
sim->InitSimulationModule(GetModule(module),evNumber/*,gAlice->GetEvNumber()*/,GetSegmentation(lr),GetResponseParam(lr));
sim->SDigitiseModule();
fLoader->TreeS()->Fill(); // fills all branches - wasted disk space
ResetSDigits();
}
Expand Down Expand Up @@ -544,10 +564,10 @@ void AliITSU::Hits2Digits(Int_t evNumber,Int_t bgrev,Option_t *option,const char
//
Int_t nmodules = fGeomTGeo->GetNModules();
for (Int_t module=0;module<nmodules;module++) {
int id = fGeomTGeo->GetModuleDetTypeID(module);
AliITSUSimulation* sim = GetSimulationModel(id);
if (!sim) AliFatal(Form("The sim.class for module %d of DetTypeID %d is missing",module,id));
sim->DigitiseModule( GetModule(module) ,module, evNumber, GetSegmentation(id));
int lr = fGeomTGeo->GetLayer(module);
AliITSUSimulation* sim = GetSimulationModel(lr);
sim->InitSimulationModule(GetModule(module),evNumber/*gAlice->GetEvNumber()*/,GetSegmentation(lr),GetResponseParam(lr));
sim->DigitiseModule();
// fills all branches - wasted disk space
fLoader->TreeD()->Fill();
ResetDigits();
Expand Down Expand Up @@ -786,13 +806,9 @@ void AliITSU::SDigits2Digits()
//
int nmodules = fGeomTGeo->GetNModules();
for (int module=0;module<nmodules;module++) {
int id = fGeomTGeo->GetModuleDetTypeID(module);
AliITSUSimulation *sim = GetSimulationModel(id);
if(!sim){
AliFatal(Form("The sim.class for module %d of DetTypeID %d is missing",module,id));
exit(1);
}
sim->InitSimulationModule(module,gAlice->GetEvNumber(),GetSegmentation(id));
int lr = fGeomTGeo->GetLayer(module);
AliITSUSimulation* sim = GetSimulationModel(lr);
sim->InitSimulationModule(GetModule(module),gAlice->GetEvNumber(),GetSegmentation(lr),GetResponseParam(lr));
fSDigits->Clear();
brchSDigits->GetEvent(module);
sim->AddSDigitsToModule(fSDigits,0);
Expand All @@ -814,27 +830,54 @@ void AliITSU::InitSimulation()
//
if (fSimInitDone) {AliInfo("Already done"); return;}
//
fSimuParam = new AliITSUSimuParam();
AliCDBEntry* cdbEnt = AliCDBManager::Instance()->Get("ITS/Calib/SimuParam"); // tmp: load it centrally
if (!cdbEnt) {AliFatal("Failed to find ITS/Calib/SimuParam on CDB"); exit(1);}
fSimuParam = (AliITSUSimuParam*)cdbEnt->GetObject();
//
fSensMap = new AliITSUSensMap("AliITSUSDigit",0,0);
fSimulation = new TObjArray(kNDetTypes);
fSegmentation = new TObjArray();
AliITSUSegmentationPix::LoadSegmentations(fSegmentation, AliITSUGeomTGeo::GetITSsegmentationFileName());
fSegmentation->SetOwner(kTRUE);
fSimModelLr = new AliITSUSimulation*[fNLayers];
fSegModelLr = new AliITSsegmentation*[fNLayers];
fResponseLr = new AliParamList*[fNLayers];
//
TObjArray arrSeg;
AliITSUSegmentationPix::LoadSegmentations(&arrSeg, AliITSUGeomTGeo::GetITSsegmentationFileName());
//
// add known simulation types used in the setup
for (int i=fNLayers;i--;) {
int sType = fGeomTGeo->GetLayerDetTypeID(i)/AliITSUGeomTGeo::kMaxSegmPerDetType;
if (fSimulation->At(sType)) continue;
fSimModelLr[i] = 0;
fSegModelLr[i] = 0;
fResponseLr[i] = 0;
int dType = fGeomTGeo->GetLayerDetTypeID(i); // fine detector type: class + segmentation
int sType = dType/AliITSUGeomTGeo::kMaxSegmPerDetType; // detector simulation class
//
// check if the simulation of this sType was already created for preceeding layers
AliITSUSimulation* simUpg = 0;
switch (sType) {
case AliITSUGeomTGeo::kDetTypePix :
simUpg = new AliITSUSimulationPix(fSimuParam,fSensMap);
break;
default: AliFatal(Form("No %d detector type is defined",sType));
};
fSimulation->AddAtAndExpand(simUpg,sType);
for (int j=fNLayers-1;j>i;j--) {
simUpg = GetSimulationModel(j);
if (simUpg && int(simUpg->GetUniqueID())==sType) break;
else simUpg = 0;
}
//
if (!simUpg) { // need to create simulation for detector class sType
switch (sType)
{
case AliITSUGeomTGeo::kDetTypePix :
simUpg = new AliITSUSimulationPix(fSimuParam,fSensMap);
break;
default: AliFatal(Form("No %d detector type is defined",sType));
}
}
fSimModelLr[i] = simUpg;
//
// add segmentations used in the setup
if (!(fSegModelLr[i]=(AliITSsegmentation*)arrSeg[dType])) {AliFatal(Form("Segmentation for DetType#%d is not found",dType)); exit(1);}
//
// add response function for the detectors of this layer
if ( !(fResponseLr[i]=(AliParamList*)fSimuParam->FindRespFunParams(dType)) ) {AliFatal(Form("Response for DetType#%d is not found in SimuParams",dType)); exit(1);}
}
// delete non needed segmentations
for (int i=fNLayers;i--;) arrSeg.Remove(fSegModelLr[i]);
arrSeg.Delete();
//
InitArrays();
//
Expand Down
12 changes: 7 additions & 5 deletions ITS/UPGRADE/AliITSU.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AliITSdigit;
class AliDigitizationInput;
class AliITSUSensMap;
class AliITSUSimuParam;

class AliParamList;

class AliITSU : public AliDetector {

Expand Down Expand Up @@ -69,8 +69,9 @@ class AliITSU : public AliDetector {
virtual void MakeBranchD(const char* file);
virtual void MakeBranchInTreeD(TTree* treeD, const char* file=0);
virtual void SetTreeAddress();
virtual AliITSUSimulation* GetSimulationModel(Int_t id) {return (AliITSUSimulation*)fSimulation->At(id/AliITSUGeomTGeo::kMaxSegmPerDetType);}
virtual AliITSsegmentation* GetSegmentation(Int_t id) {return (AliITSsegmentation*) fSegmentation->At(id);}
virtual AliITSUSimulation* GetSimulationModel(Int_t lr) {return (AliITSUSimulation*)fSimModelLr[lr];}
virtual AliITSsegmentation* GetSegmentation(Int_t lr) {return (AliITSsegmentation*)fSegModelLr[lr];}
virtual AliParamList* GetResponseParam(Int_t lr) {return (AliParamList*)fResponseLr[lr];}
//=================== Hits =========================================
virtual void StepManager() {} // See Step Manager for specific geometry.
//------------ sort hits by module for Digitisation ----------------
Expand Down Expand Up @@ -139,8 +140,9 @@ class AliITSU : public AliDetector {
TObjArray* fDetDigits; //! AliDetector has TClonesArray fDigits, avoid same name
AliITSUSensMap* fSensMap; //! sensor map for digitization
//
TObjArray *fSimulation; //! simulation objects per det.type
TObjArray *fSegmentation; //! segmentation objects per det.type (and segmentation)
AliITSUSimulation **fSimModelLr; //! simulation objects per layer
AliITSsegmentation **fSegModelLr; //! segmentation objects per layar
AliParamList **fResponseLr; //! response parameters for each layer
TObjArray *fCalibration; //! calibration objects
Int_t fRunNumber; //! run number
Bool_t fSimInitDone; //! flag initialized simulation
Expand Down
8 changes: 4 additions & 4 deletions ITS/UPGRADE/AliITSUDigitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ void AliITSUDigitizer::Digitize(Option_t* /*opt*/)
for (int module=0; module<nModules; module++ ) {
//
if (!fRoif && !fModActive[module]) continue;
int id = geom->GetModuleDetTypeID(module);
AliITSUSimulation *sim = fITS->GetSimulationModel(id);
if (!sim) AliFatal(Form("The simulation model %d is not available",id));
int lr = geom->GetLayer(module);
AliITSUSimulation *sim = fITS->GetSimulationModel(lr);
if (!sim) AliFatal(Form("The simulation model for layer %d is not available",lr));
//
// Fill the module with the sum of SDigits
sim->InitSimulationModule(module, event, fITS->GetSegmentation(id));
sim->InitSimulationModule(fITS->GetModule(module), event, fITS->GetSegmentation(lr), fITS->GetResponseParam(lr));
//
for (int ifiles=0; ifiles<nfiles; ifiles++ ) {
//
Expand Down
24 changes: 15 additions & 9 deletions ITS/UPGRADE/AliITSURecoDet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,21 @@ Bool_t AliITSURecoDet::Build()
}
//
// TPC-ITS wall
lrp = new AliITSURecoLayer("TPC-ITSwall");
lrp->SetRMin(AliITSUReconstructor::GetRecoParam()->GetTPCITSWallRMin());
lrp->SetRMax(AliITSUReconstructor::GetRecoParam()->GetTPCITSWallRMax());
lrp->SetR(0.5*(lrp->GetRMin()+lrp->GetRMax()));
lrp->SetZMin(-AliITSUReconstructor::GetRecoParam()->GetTPCITSWallZSpanH());
lrp->SetZMax( AliITSUReconstructor::GetRecoParam()->GetTPCITSWallZSpanH());
lrp->SetMaxStep( AliITSUReconstructor::GetRecoParam()->GetTPCITSWallMaxStep());
lrp->SetPassive(kTRUE);
AddLayer(lrp);
const AliITSURecoParam* recopar = AliITSUReconstructor::GetRecoParam();
if (recopar) {
lrp = new AliITSURecoLayer("TPC-ITSwall");
lrp->SetRMin(AliITSUReconstructor::GetRecoParam()->GetTPCITSWallRMin());
lrp->SetRMax(AliITSUReconstructor::GetRecoParam()->GetTPCITSWallRMax());
lrp->SetR(0.5*(lrp->GetRMin()+lrp->GetRMax()));
lrp->SetZMin(-AliITSUReconstructor::GetRecoParam()->GetTPCITSWallZSpanH());
lrp->SetZMax( AliITSUReconstructor::GetRecoParam()->GetTPCITSWallZSpanH());
lrp->SetMaxStep( AliITSUReconstructor::GetRecoParam()->GetTPCITSWallMaxStep());
lrp->SetPassive(kTRUE);
AddLayer(lrp);
}
else {
AliWarning("RecoParam is not available, TPC-ITS wall is not set");
}
//
IndexLayers();
Print("lr");
Expand Down
Loading

0 comments on commit e0e5fd5

Please sign in to comment.