本文整理汇总了C++中TChain::AddFileInfoList方法的典型用法代码示例。如果您正苦于以下问题:C++ TChain::AddFileInfoList方法的具体用法?C++ TChain::AddFileInfoList怎么用?C++ TChain::AddFileInfoList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TChain
的用法示例。
在下文中一共展示了TChain::AddFileInfoList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runProofFwdDetsQA
void runProofFwdDetsQA(const char * dataset = "/COMMON/COMMON/LHC09a4_run8101X",Long64_t nentries=100000, Long64_t firstentry=0)
{
gSystem->Load("libANALYSIS");
gSystem->Load("libANALYSISalice");
gSystem->AddIncludePath("-I$ALICE_ROOT/include");
// Connect to Proof
gEnv->SetValue("XSec.GSI.DelegProxy","2");
TProof::Open("cheshkov:[email protected]");
// Upload and enable packages: please use the correct version!
gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
gProof->EnablePackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-16-Release/AF-v4-16");
// Create the analysis manager
AliAnalysisManager *mgr = new AliAnalysisManager("AliAnaFwdDetsQA");
AliVEventHandler* esdH = new AliESDInputHandler();
mgr->SetInputEventHandler(esdH);
// Enable MC event handler
AliVEventHandler* handler = new AliMCEventHandler;
mgr->SetMCtruthEventHandler(handler);
// Create task
gProof->Load(Form("%s/PWGPP/AliAnaFwdDetsQA.cxx++g",
gSystem->Getenv("ALICE_ROOT")));
AliAnalysisTask *task = new AliAnaFwdDetsQA("AliAnaFwdDetsQA");
// Add task
mgr->AddTask(task);
// Create containers for input/output
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
AliAnalysisDataContainer *coutput =
mgr->CreateContainer("coutput", TList::Class(),
AliAnalysisManager::kOutputContainer, "FwdDetsQA.root");
// Connect input/output
mgr->ConnectInput(task, 0, cinput);
mgr->ConnectOutput(task, 1, coutput);
// Enable debug printouts
mgr->SetDebugLevel(3);
if (!mgr->InitAnalysis())
return;
mgr->PrintStatus();
TFileCollection *proofColl = gProof->GetDataSet(dataset);
TChain *chain = new TChain("esdTree");
chain->AddFileInfoList((TCollection*)(proofColl->GetList()));
mgr->StartAnalysis("proof", chain, nentries, firstentry);
// mgr->StartAnalysis("proof",dataset,nentries,firstentry);
}
示例2: trim
void trim(const char* treepath = "/media/Disk1/avartak/CMS/Data/Dileptons/DoubleMuon/tree*.root", const char* outfilename = "/media/Disk1/avartak/CMS/Data/Dileptons/DoubleMuon/trim.root", bool isMC = false) {
TFile purwtfile("../data/purwt.root");
TFile muoidfile("../data/muonIDIsoSF.root");
TH1F* purwthist = (TH1F*)purwtfile.Get("puhist");
TH2F* muidlhist = (TH2F*)muoidfile.Get("scalefactors_MuonMediumId_Muon");
TH2F* muidmhist = (TH2F*)muoidfile.Get("scalefactors_MuonMediumId_Muon");
TH2F* muidthist = (TH2F*)muoidfile.Get("scalefactors_TightId_Muon" );
TH2F* muislhist = (TH2F*)muoidfile.Get("scalefactors_Iso_MuonMediumId" );
TH2F* muismhist = (TH2F*)muoidfile.Get("scalefactors_Iso_MuonMediumId" );
TH2F* muisthist = (TH2F*)muoidfile.Get("scalefactors_Iso_MuonTightId" );
TFileCollection fc("fc");
fc.Add(treepath);
TChain* chain = new TChain("mmtree/tree");
chain->AddFileInfoList(fc.GetList());
TTreeReader reader(chain);
TTreeReaderValue<double> xsec (reader, "xsec" );
TTreeReaderValue<double> wgt (reader, "wgt" );
TTreeReaderValue<unsigned> nvtx (reader, "nvtx" );
TTreeReaderValue<std::vector<TLorentzVector> > dimuons (reader, "dimuons" );
TTreeReaderValue<std::vector<unsigned> > m1idx (reader, "m1idx" );
TTreeReaderValue<std::vector<unsigned> > m2idx (reader, "m2idx" );
TTreeReaderValue<std::vector<double> > masserr (reader, "masserr" );
TTreeReaderValue<std::vector<TLorentzVector> > muons (reader, "muons" );
TTreeReaderValue<std::vector<double> > miso (reader, "miso" );
TTreeReaderValue<std::vector<char> > mid (reader, "mid" );
TTreeReaderValue<unsigned char> hlt2m (reader, "hltdoublemu");
TTreeReaderValue<unsigned char> hlt1m (reader, "hltsinglemu");
TFile* outfile = new TFile(outfilename, "RECREATE");
TTree* outtree = new TTree("tree", "tree");
double wgtsum = isMC ? sumwgt(treepath) : 1.0;
double mcwgt = 1.0;
double puwgt = 1.0;
double lidw1 = 1.0;
double lidw2 = 1.0;
double midw1 = 1.0;
double midw2 = 1.0;
double tidw1 = 1.0;
double tidw2 = 1.0;
double m1pt = 0.0;
double m1eta = 0.0;
double m1phi = 0.0;
double m1iso = 0.0;
double m2pt = 0.0;
double m2eta = 0.0;
double m2phi = 0.0;
double m2iso = 0.0;
double mmpt = 0.0;
double mmeta = 0.0;
double mmphi = 0.0;
double mass = 0.0;
double merr = 0.0;
char m1id = 0;
char m2id = 0;
char trig1m = 0;
char trig2m = 0;
outtree->Branch("mcwgt" , &mcwgt , "mcwgt/D" );
outtree->Branch("puwgt" , &puwgt , "puwgt/D" );
outtree->Branch("lidw1" , &lidw1 , "lidw1/D" );
outtree->Branch("lidw2" , &lidw2 , "lidw2/D" );
outtree->Branch("midw1" , &midw1 , "midw1/D" );
outtree->Branch("midw2" , &midw2 , "midw2/D" );
outtree->Branch("tidw1" , &tidw1 , "tidw1/D" );
outtree->Branch("tidw2" , &tidw2 , "tidw2/D" );
outtree->Branch("m1pt" , &m1pt , "m1pt/D" );
outtree->Branch("m1eta" , &m1eta , "m1eta/D" );
outtree->Branch("m1eta" , &m1phi , "m1phi/D" );
outtree->Branch("m1id" , &m1id , "m1id/B" );
outtree->Branch("m1iso" , &m1iso , "m1iso/D" );
outtree->Branch("m2pt" , &m2pt , "m2pt/D" );
outtree->Branch("m2eta" , &m2eta , "m2eta/D" );
outtree->Branch("m2eta" , &m2phi , "m2phi/D" );
outtree->Branch("m2id" , &m2id , "m2id/B" );
outtree->Branch("m2iso" , &m2iso , "m2iso/D" );
outtree->Branch("mmpt" , &mmpt , "mmpt/D" );
outtree->Branch("mmeta" , &mmeta , "mmeta/D" );
outtree->Branch("mmeta" , &mmphi , "mmphi/D" );
outtree->Branch("mass" , &mass , "mass/D" );
outtree->Branch("merr" , &merr , "merr/D" );
outtree->Branch("trig1m", &trig1m, "trig1m/b");
outtree->Branch("trig2m", &trig2m, "trig2m/b");
while(reader.Next()) {
if (muons->size() != 2) continue;
if (dimuons->size() != 1) continue;
unsigned numvtx = *nvtx;
if (numvtx > 40) numvtx = 40;
//.........这里部分代码省略.........