Skip to content

Commit

Permalink
ATO-46, ATO-360 - Adding AliExternalInfo::GetCPassTree(const char * p…
Browse files Browse the repository at this point in the history
…eriod, const char *pass)
  • Loading branch information
miranov25 committed Jun 21, 2016
1 parent 79c1278 commit 92bbd12
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
34 changes: 33 additions & 1 deletion STAT/AliExternalInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Bool_t AliExternalInfo::AddTree(TTree* tree, TString type){
::Error("AliExternalInfo::AddTree","Index %s not avaible for type %s", indexName.Data(), type.Data());
}
}else{
if ( tree->GetListOfBranches()->FindObject("run") || tree->GetListOfAliases()->FindObject("run")) {
if ( tree->GetListOfBranches()->FindObject("run") || ( tree->GetListOfAliases() && tree->GetListOfAliases()->FindObject("run"))) {
tree->BuildIndex("run");
indexName="run";
}
Expand Down Expand Up @@ -525,3 +525,35 @@ const TString AliExternalInfo::Wget(TString& mifFilePath, const TString& interna
mifFilePath.Data(), externalLocation.Data());
return command;
}


/// \param period LHC period
/// \param pass calibratio pass

TTree * AliExternalInfo::GetCPassTree(const char * period, const char *pass){
//
// Try to find production information about pass OCDB export
// To find the production description field of the overlal production table is queried
//
// Warnig:
// In some cases mif format internaly used not stable
// Unit consistency test should be part of procedure
//
TTree * treeProdArray=0, *treeProd=0;
AliExternalInfo info;
treeProdArray = info.GetTreeCPass();
treeProdArray->Scan("ID:Description:Tag",TString::Format("strstr(Tag,\"%s\")&&strstr(Tag,\"%s\")&& strstr(Description,\"merging\")",period,pass).Data(),"col=10:100:100");
// check all candidata production and select one which exports OCDB
Int_t entries= treeProdArray->Draw("ID:Description",TString::Format("strstr(Description,\"%s\")&&strstr(Description,\"%s\")&& strstr(Description,\"merging\")",period,pass).Data(),"goff");
for (Int_t ientry=0; ientry<entries; ientry++){
TTree * treeProd0 = info.GetTreeProdCycleByID(TString::Format("%.0f",treeProdArray->GetV1()[ientry]).Data());
Int_t status = treeProd0->Draw("1","strstr(outputdir,\"OCDB\")==1","goff"); // check presence of the OCDB
if (status==0) {
delete treeProd0;
continue;
}
treeProd=treeProd0;
}
return treeProd;
}

1 change: 1 addition & 0 deletions STAT/AliExternalInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class AliExternalInfo : public TObject {
TTree* GetTreeProdCycle() {return GetTree("MonALISA.ProductionCycle", "", "");}
TTree* GetTreeCPass() {return GetTree("MonALISA.ProductionCPass", "", "");}
TTree* GetTreeProdCycleByID(TString ID) {return GetTree("MonALISA.ProductionCycleID", ID, "");}
TTree* GetCPassTree(const char * period, const char *pass);

TChain* GetChain(TString type, TString period, TString pass);
TChain* GetChainMC() {return GetChain("MonALISA.MC", "", "");}
Expand Down

0 comments on commit 92bbd12

Please sign in to comment.