source /opt/usatlas/kit_rel/14.1.0/cmtsite/setup.sh -tag=14.1.0
GroupArea=/afs/usatlas/project/analysis/ARA_GroupArea/ARA_Tags_14.1.0
export CMTPATH=$GroupArea:$CMTPATH
source /opt/usatlas/kit_rel/14.1.0/AtlasOffline/14.1.0/AtlasOfflineRunTime/cmt/setup.sh
Please visit the detailed setup on how to set up the release 14.1.0 at BNL.
After the release setup, please run the following to save 4 environment variables into a file which will be used later:
proof=proof-setenv-14.1.0.sh
echo "export ROOTSYS=$ROOTSYS" > $proof
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $proof
echo "export PYTHONPATH=$PYTHONPATH" >> $proof
PYTHONHOME=`which python | sed 's%/bin/python$%%'`
echo "export PYTHONHOME=$PYTHONHOME" >> $proof
Please notice that the ROOT version for ARA is bound to the one coming with the release, and other ROOT version cannot be used.
$ root -l
root [0] TPython::Exec("import PyCintex,AthenaROOTAccess.transientTree");
root [1] TChain* chain = new TChain("CollectionTree");
root [2] chain->Add(""/usatlas/groups/top/hma/fdr2/fdr08_run2.0052280.physics_Egamma.merge.AOD.o3_f8_m10/fdr08_run2.0052280.physics_Egamma.merge.AOD.o3_f8_m10._0001.1");
root [2] TPython::Bind(chain,"myTree");
root [3] TPython::LoadMacro("/usatlas/workarea/yesw2000/root/Proof/14.1.0/Examples/open-tree.py");
root [4] TTree* tree_trans = gROOT->Get("CollectionTree_trans");
root [5] tree_trans->MakeSelector("mySelector");
The TSelector files, "mySelector.h" and "mySelector.C", will be created.
The file open-tree.py in the above example reads:
global myTree
print myTree.GetName()
branchNames = {}
tt = AthenaROOTAccess.transientTree.makeTree(myTree, branchNames = branchNames)
print tt
TTree* m_TreeTran;
and add members for pointer to histograms you want to create, something like:TH1F *h1_Gam_phi, *h1_mu_n, *h1_mu_m2mu;
TPython::Bind(tree,"myTree");
TString str_TreeTran(tree->GetName());
str_TreeTran += "_trans";
TObject* obj = gROOT->FindObject(str_TreeTran.Data());
if (obj) obj->Delete();
TPython::LoadMacro("/usatlas/workarea/yesw2000/root/Proof/14.1.0/Examples/open-tree.py");
m_TreeTran = (TTree*)gDirectory->Get(str_TreeTran.Data());
Next you need edit "mySelector.C":
1. In SlaveBegin function, define your histograms
h1_Gam_phi = new TH1F("h1_Gam_phi","#phi(#gamma)", 100, -3.1416, 3.1416);
fOutput->Add(h1_Gam_phi);
h1_mu_n = new TH1F("h1_mu_n","N(#mu)",10,0,10);
fOutput->Add(h1_mu_n);
h1_mu_m2mu = new TH1F("h1_mu_m2mu","M(#mu#mu)",100,0,200.);
fOutput->Add(h1_mu_m2mu);
// b_PhotonAODCollection->GetEntry(entry); // b_StreamingEventInfo->GetEntry(entry); // b_MuidMuonCollection->GetEntry(entry); m_TreeTran->GetEntry(entry); ... put your analysis code and fill histograms here ...
fOuput->Print();
TFile* file = new TFile("my-results.root","RECREATE");
fOutput->Write();
file->Close();
$ root -l
root [0] TPython::LoadMacro("DQ2IF.py");
root [1] TProof::AddEnvVar("PROOF_INITCMD","source /usatlas/workarea/yesw2000/root/Proof/14.1.0/Examples/proof-setenv-14.1.0.sh");
root [2] TProof* p = TProof::Open("acas0420");
root [3] p->Exec("TPython::Exec(\"import PyCintex,AthenaROOTAccess.transientTree\")");
ROOTSYS, LD_LIBRARY_PATH and PYTHONPATH.
root [4] TChain* chain = new TChain("CollectionTree");
root [5] TPython::Bind(chain,"myChain");
root [6] DQ2IF dq2;
root [7] dq2.getFiles("fdr08_run2.0052283.physics_Egamma.merge.AOD.o3_f8_m10", "myChain");
root [8] chain->SetProof(kTRUE,kTRUE);
root [9] chain->Process("mySelector.C");
Please note that this site is a content mirror of the BNL USATLAS TWiki. To edit the content of this page, click the Edit this page button at the top of the page and log in with your BNL USATLAS account.