当前位置: 首页>>代码示例>>C++>>正文


C++ TChain::SetBranchStatus方法代码示例

本文整理汇总了C++中TChain::SetBranchStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ TChain::SetBranchStatus方法的具体用法?C++ TChain::SetBranchStatus怎么用?C++ TChain::SetBranchStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TChain的用法示例。


在下文中一共展示了TChain::SetBranchStatus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: spikes_getContamFromMerged


//.........这里部分代码省略.........
  myChain->SetBranchAddress("spike_Riphi",&spike_Riphi);
  myChain->SetBranchAddress("spike_severityLevel",&spike_severityLevel);
  myChain->SetBranchAddress("spike_outOfTime",&spike_outOfTime);
  myChain->SetBranchAddress("spike_Et",&spike_Et);
  myChain->SetBranchAddress("spike_eta",&spike_eta);
  myChain->SetBranchAddress("spike_phi",&spike_phi);
  myChain->SetBranchAddress("spike_theta",&spike_theta);
//
  myChain->SetBranchAddress("spike_maxEGtrig",&spike_maxEGtrig);
  myChain->SetBranchAddress("spike_maxEGtrig_To",&spike_maxEGtrig_To);
  myChain->SetBranchAddress("spike_maxEGtrig_M_To",&spike_maxEGtrig_M_To);

  myChain->SetBranchAddress("trig_tower_N", &trig_tower_N);
  myChain->SetBranchAddress("trig_tower_ieta",  &trig_tower_ieta);
  myChain->SetBranchAddress("trig_tower_iphi",  &trig_tower_iphi);
  myChain->SetBranchAddress("trig_tower_adc",  &trig_tower_adc);
  myChain->SetBranchAddress("trig_tower_sFGVB",  &trig_tower_sFGVB);
  myChain->SetBranchAddress("trig_tower_FG",  &trig_tower_FG);

  myChain->SetBranchAddress("trig_tower_N_E",     &trig_tower_N_E);
  myChain->SetBranchAddress("trig_tower_ieta_E",  &trig_tower_ieta_E);
  myChain->SetBranchAddress("trig_tower_iphi_E",  &trig_tower_iphi_E);
  myChain->SetBranchAddress("trig_tower_adc_E",   &trig_tower_adc_E);
  myChain->SetBranchAddress("trig_tower_sFGVB_E", &trig_tower_sFGVB_E);
  myChain->SetBranchAddress("trig_tower_FG_E", &trig_tower_FG_E);

  // HCAL TP                                                        
  myChain->SetBranchAddress("trig_tower_hcal_N", &trig_tower_hcal_N);
  myChain->SetBranchAddress("trig_tower_hcal_ieta",  &trig_tower_hcal_ieta);
  myChain->SetBranchAddress("trig_tower_hcal_iphi",  &trig_tower_hcal_iphi);
  myChain->SetBranchAddress("trig_tower_hcal_et",  &trig_tower_hcal_et);
  myChain->SetBranchAddress("trig_tower_hcal_FG",  &trig_tower_hcal_FG);

  myChain->SetBranchStatus("trig_tower*",0);
  
  // L1 candidates collections                        
  myChain->SetBranchAddress("trig_L1emIso_N", &trig_L1emIso_N);
  myChain->SetBranchAddress("trig_L1emIso_ieta", &trig_L1emIso_ieta);
  myChain->SetBranchAddress("trig_L1emIso_iphi", &trig_L1emIso_iphi);
  myChain->SetBranchAddress("trig_L1emIso_rank", &trig_L1emIso_rank);

  myChain->SetBranchAddress("trig_L1emNonIso_N", &trig_L1emNonIso_N);
  myChain->SetBranchAddress("trig_L1emNonIso_ieta", &trig_L1emNonIso_ieta);
  myChain->SetBranchAddress("trig_L1emNonIso_iphi", &trig_L1emNonIso_iphi);
  myChain->SetBranchAddress("trig_L1emNonIso_rank", &trig_L1emNonIso_rank);

  myChain->SetBranchAddress("trig_L1emIso_N_To", &trig_L1emIso_N_To);
  myChain->SetBranchAddress("trig_L1emIso_ieta_To", &trig_L1emIso_ieta_To);
  myChain->SetBranchAddress("trig_L1emIso_iphi_To", &trig_L1emIso_iphi_To);
  myChain->SetBranchAddress("trig_L1emIso_rank_To", &trig_L1emIso_rank_To);

  myChain->SetBranchAddress("trig_L1emNonIso_N_To", &trig_L1emNonIso_N_To);
  myChain->SetBranchAddress("trig_L1emNonIso_ieta_To", &trig_L1emNonIso_ieta_To);
  myChain->SetBranchAddress("trig_L1emNonIso_iphi_To", &trig_L1emNonIso_iphi_To);
  myChain->SetBranchAddress("trig_L1emNonIso_rank_To", &trig_L1emNonIso_rank_To);

  myChain->SetBranchAddress("trig_L1emIso_N_M_To", &trig_L1emIso_N_M_To);
  myChain->SetBranchAddress("trig_L1emIso_ieta_M_To", &trig_L1emIso_ieta_M_To);
  myChain->SetBranchAddress("trig_L1emIso_iphi_M_To", &trig_L1emIso_iphi_M_To);
  myChain->SetBranchAddress("trig_L1emIso_rank_M_To", &trig_L1emIso_rank_M_To);

  myChain->SetBranchAddress("trig_L1emNonIso_N_M_To", &trig_L1emNonIso_N_M_To);
  myChain->SetBranchAddress("trig_L1emNonIso_ieta_M_To", &trig_L1emNonIso_ieta_M_To);
  myChain->SetBranchAddress("trig_L1emNonIso_iphi_M_To", &trig_L1emNonIso_iphi_M_To);
  myChain->SetBranchAddress("trig_L1emNonIso_rank_M_To", &trig_L1emNonIso_rank_M_To);
开发者ID:fanbomeng,项目名称:Ecal_Turnon_2012_data,代码行数:66,代码来源:spikes_getContamFromMerged.C

示例2: main

int main(int argc,char *argv[]) {   // code starts // main
  
  TApplication myApp("myApp", 0, 0 ,0,-1);   
  
  vector<string> inFileList;   // process the file input file list (in case it is desired to run multiple root files as input
  int returnCode = processCommandLineArgs( argc, argv, inFileList);
  if(returnCode!=0){
    cerr << "Error\n";
    return returnCode;
  }
  
  TChain *dataTree = new TChain("dataTree"); // open a TChain and add the opened root files to it
  for (unsigned int i = 0; i < inFileList.size(); ++i)
    dataTree->Add(inFileList[i].c_str());
  cout << "number of events: " << dataTree->GetEntries() << endl;  // check the number of entries in the TChain
  
  int sizeTDC_0,sizeTDC_1,sizeTDC_2;   // cuántos hits hubieron en un evento
  double TDC_LE_0[kHitsTDCmax];   // todos los flancos iniciales de los pulsos de un evento, canal 0 (leading edge)
  double TDC_LE_1[kHitsTDCmax];   // todos los flancos iniciales de los pulsos de un evento, canal 1
  double TDC_LE_2[kHitsTDCmax];
  
  double TDC_TE_0[kHitsTDCmax];   // todos los flancos finales de los pulsos de un evento, canal 0 (trailing edge)
  double TDC_TE_1[kHitsTDCmax];
  double TDC_TE_2[kHitsTDCmax];
  
  // determina el estado de las ramas del árbol de root //
  dataTree->SetBranchStatus("*",0);          // apaga todas las ramas
  dataTree->SetBranchStatus("sizeTDC_0",1);  // enciente la rama sizeTDC_0 
  dataTree->SetBranchStatus("sizeTDC_1",1);  // ...
  dataTree->SetBranchStatus("sizeTDC_2",1);
  dataTree->SetBranchStatus("TDC_LE_0",1);
  dataTree->SetBranchStatus("TDC_LE_1",1);
  dataTree->SetBranchStatus("TDC_LE_2",1);
  dataTree->SetBranchStatus("TDC_TE_0",1);
  dataTree->SetBranchStatus("TDC_TE_1",1);
  dataTree->SetBranchStatus("TDC_TE_2",1);
  
  // vincula las ramas del árbol de root con las variables declaradas más arriba
  dataTree->SetBranchAddress("sizeTDC_0",&sizeTDC_0);   // vincula la rama entre comillas llamada sizeTDC_0 con la direccón de memoria donde vive la variable previamente declarada (que hemos llamado igual por simplicidad)
  dataTree->SetBranchAddress("sizeTDC_1",&sizeTDC_1);
  dataTree->SetBranchAddress("sizeTDC_2",&sizeTDC_2);
  dataTree->SetBranchAddress("TDC_LE_0",&TDC_LE_0);
  dataTree->SetBranchAddress("TDC_LE_1",&TDC_LE_1);
  dataTree->SetBranchAddress("TDC_LE_2",&TDC_LE_2);
  dataTree->SetBranchAddress("TDC_TE_0",&TDC_TE_0);
  dataTree->SetBranchAddress("TDC_TE_1",&TDC_TE_1);
  dataTree->SetBranchAddress("TDC_TE_2",&TDC_TE_2);  
  
  { // Open the Ttree and index it event-by-event
    
	int n_events = (int) dataTree->GetEntries();

	/// 
	/// Inicio
	/// 
	// Placas en Arreglo A-ch0  B-ch1 C-ch2

	int ventana = 50; //Nanosegundos
	int contadorFiltro = 0; 
	int veto = 500; //Nanosegundos
	ofstream salida;
	salida.open("filtro.dat"); //archivo de salida

     
	for(int i=0; i<n_events; i++){  // loop over the number of events start
      
		dataTree->GetEntry(i);   // pido que la entrada del árbol llene las variables previamente declaradas
     
		///////////////////////////////////////////////////

		if (sizeTDC_0==1 && sizeTDC_1==1 && sizeTDC_2==1) //Exactamente un conteo en cada placa
		{
			if ( (TDC_LE_2[0]- TDC_LE_0[0]) <= ventana ) // A y C en coincidencia
			{
				if ( (TDC_LE_1[0]- TDC_LE_2[0]) >= veto ) // Sólo se toman en cuenta pulsos con mayor duración al veto
				{
					salida << TDC_LE_1[0] - TDC_LE_2[0] << endl ; //Salida al archivo
					contadorFiltro++;
				}
			}
		}

  } // End of indexing the TTree

	//Razón decaimientos muón / eventos totales

		double razon = static_cast <double> (contadorFiltro) / n_events ;

		cout << razon << endl;

		salida.close();
  }

  
  return 0;  // main end
}
开发者ID:ECFM-USAC,项目名称:Escaramujo,代码行数:96,代码来源:main.cpp

示例3: process


//.........这里部分代码省略.........
    //
    for(int j=0 ; j<5 ; j++) {
      trig_strip_mask_xtal_ix[i][j] = -999;
      trig_strip_mask_xtal_iy[i][j] = -999;
      trig_strip_mask_xtal_iz[i][j] = -999;
    }
    trig_xtal_mask_ieta[i] = -999;
    trig_xtal_mask_iphi[i] = -999;
    trig_xtal_mask_TTieta[i] = -999;
    trig_xtal_mask_TTiphi[i] = -999;
    trig_xtal_mask_Rieta[i] = -999;
    trig_xtal_mask_Riphi[i] = -999;
    trig_xtal_mask_status[i] = -999;
    trig_xtal_mask_EBEE[i] = -999;
  }

  cout<<"test3"<<endl;
  // Disable useless branches
  //myChain->SetBranchStatus("spike_*",0);
  //myChain->SetBranchStatus("vtx_*",0);
  //myChain->SetBranchStatus("skim_*",0);
  //myChain->SetBranchStatus("trig_pre*",0);
  //myChain->SetBranchStatus("trig_post*",0);
  //myChain->SetBranchStatus("trig_HLT*",0);
  //myChain->SetBranchStatus("BS*",0);
  //myChain->SetBranchStatus("MC_*",0);
  //myChain->SetBranchStatus("ele_MC*",0);
  ////myChain->SetBranchStatus("ele_eid*",0);
  ////myChain->SetBranchStatus("ele_Seed*",0);
  //myChain->SetBranchStatus("ele_charge*",0);
  //myChain->SetBranchStatus("met_*",0);
  //myChain->SetBranchStatus("muons*",0);
  //myChain->SetBranchStatus("jets*",0);
  myChain->SetBranchStatus("sc*",0);
  //myChain->SetBranchStatus("sc_hybrid_N",1);
  //myChain->SetBranchStatus("",0);

  // Global
  myChain->SetBranchAddress("nEvent",&nEvent);
  myChain->SetBranchAddress("nRun",&nRun);
  myChain->SetBranchAddress("nLumi",&nLumi);

  // Trigger
//   myChain->SetBranchAddress ("trig_HLT_triggered", &m_HLT_triggered);
//   myChain->SetBranchAddress ("trig_HLT_pathsV", &m_HLT_pathsV);
//   myChain->SetBranchAddress ("trig_HLT_pathsV_check", &m_HLT_pathsV_check);
  //
  myChain->SetBranchAddress("trig_HLT_path",&trig_HLT_path);
  // unbias, EG5, EG8, EG12
  //
  myChain->SetBranchAddress("trig_fired_names",&trig_fired_names);
  myChain->SetBranchAddress("trig_hltInfo",&trig_hltInfo);

  // SC
  //myChain->SetBranchAddress("sc_hybrid_N",   &sc_hybrid_N);
  
  // Electrons
  myChain->SetBranchAddress("ele_N",   &ele_N);
  myChain->SetBranchAddress("electrons",&electrons);
  myChain->SetBranchAddress("ele_severityLevelSeed", &ele_severityLevelSeed);
  myChain->SetBranchAddress("ele_he",&ele_he);
  myChain->SetBranchAddress("ele_sigmaietaieta",&ele_sigmaietaieta);
  myChain->SetBranchAddress("ele_hcalDepth1TowerSumEt_dr03", &ele_hcalDepth1TowerSumEt_dr03);
  myChain->SetBranchAddress("ele_hcalDepth2TowerSumEt_dr03", &ele_hcalDepth2TowerSumEt_dr03);
  myChain->SetBranchAddress("ele_ecalRecHitSumEt_dr03", &ele_ecalRecHitSumEt_dr03);
  myChain->SetBranchAddress("ele_tkSumPt_dr03",&ele_tkSumPt_dr03);
开发者ID:fanbomeng,项目名称:Ecal_Turnon_2012_data,代码行数:67,代码来源:makePairs52X.1.3.2.C

示例4: MVAOutput


//.........这里部分代码省略.........
  inputTree->SetBranchAddress("Tau_GSFChi2", &Tau_GSFChi2);
  inputTree->SetBranchAddress("Tau_GSFNumHits", &Tau_GSFNumHits);
  inputTree->SetBranchAddress("Tau_GSFTrackResol", &Tau_GSFTrackResol);
  inputTree->SetBranchAddress("Tau_GSFTracklnPt", &Tau_GSFTracklnPt);
  inputTree->SetBranchAddress("Tau_GSFTrackEta", &Tau_GSFTrackEta);
  inputTree->SetBranchAddress("Tau_KFNumHits", &Tau_KFNumHits);
  inputTree->SetBranchAddress("Tau_EmFraction", &Tau_EmFraction); 
  inputTree->SetBranchAddress("Tau_NumChargedCands", &Tau_NumChargedCands);
  inputTree->SetBranchAddress("Tau_NumGammaCands", &Tau_NumGammaCands); 
  inputTree->SetBranchAddress("Tau_HadrHoP", &Tau_HadrHoP); 
  inputTree->SetBranchAddress("Tau_HadrEoP", &Tau_HadrEoP); 
  inputTree->SetBranchAddress("Tau_VisMass", &Tau_VisMass); 
  inputTree->SetBranchAddress("Tau_GammaEtaMom", &Tau_GammaEtaMom);
  inputTree->SetBranchAddress("Tau_GammaPhiMom", &Tau_GammaPhiMom);
  inputTree->SetBranchAddress("Tau_GammaEnFrac", &Tau_GammaEnFrac);
  inputTree->SetBranchAddress("Tau_HadrMva", &Tau_HadrMva);  
//   inputTree->SetBranchAddress("Tau_IsoMVALoose", &Tau_IsoMVALoose); 
  inputTree->SetBranchAddress("Tau_LooseComb3HitsIso", &Tau_LooseComb3HitsIso); 
  inputTree->SetBranchAddress("Tau_AntiELoose", &Tau_AntiELoose); 
  inputTree->SetBranchAddress("Tau_AntiEMedium", &Tau_AntiEMedium); 
  inputTree->SetBranchAddress("Tau_AntiETight", &Tau_AntiETight); 
  inputTree->SetBranchAddress("Tau_AntiELooseMVA3", &Tau_AntiELooseMVA3); 
  inputTree->SetBranchAddress("Tau_AntiEMediumMVA3", &Tau_AntiEMediumMVA3); 
  inputTree->SetBranchAddress("Tau_AntiETightMVA3", &Tau_AntiETightMVA3); 
  inputTree->SetBranchAddress("Tau_AntiEVTightMVA3", &Tau_AntiEVTightMVA3); 

  inputTree->SetBranchAddress("ElecVeto_Pt",&ElecVeto_Pt);

  inputTree->SetBranchAddress("Tau_DecayMode", &Tau_DecayMode); 
  inputTree->SetBranchAddress("Tau_MatchElePassVeto", &Tau_MatchElePassVeto); 

  inputTree->SetBranchAddress("classID", &classID); 

  inputTree->SetBranchStatus("*", 1);

//   string Weight_NoEleMatch_woGwoGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_woGwoGSF_Barrel_BDTG.weights.xml";
//   string Weight_NoEleMatch_woGwGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_woGwGSF_Barrel_BDTG.weights.xml";
//   string Weight_NoEleMatch_wGwoGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_wGwoGSF_Barrel_BDTG.weights.xml";
//   string Weight_NoEleMatch_wGwGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_wGwGSF_Barrel_BDTG.weights.xml";
//   string Weight_woGwoGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_woGwoGSF_Barrel_BDTG.weights.xml";
//   string Weight_woGwGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_woGwGSF_Barrel_BDTG.weights.xml";
//   string Weight_wGwoGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_wGwoGSF_Barrel_BDTG.weights.xml";
//   string Weight_wGwGSF_BL = "tmva/weights/V14/TMVAClassification_v14EleVeto_wGwGSF_Barrel_BDTG.weights.xml";
//   string Weight_NoEleMatch_woGwoGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_woGwoGSF_Endcap_BDTG.weights.xml";
//   string Weight_NoEleMatch_woGwGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_woGwGSF_Endcap_BDTG.weights.xml";
//   string Weight_NoEleMatch_wGwoGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_wGwoGSF_Endcap_BDTG.weights.xml";
//   string Weight_NoEleMatch_wGwGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_NoEleMatch_wGwGSF_Endcap_BDTG.weights.xml";
//   string Weight_woGwoGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_woGwoGSF_Endcap_BDTG.weights.xml";
//   string Weight_woGwGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_woGwGSF_Endcap_BDTG.weights.xml";
//   string Weight_wGwoGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_wGwoGSF_Endcap_BDTG.weights.xml";
//   string Weight_wGwGSF_EC = "tmva/weights/V14/TMVAClassification_v14EleVeto_wGwGSF_Endcap_BDTG.weights.xml";

  string Weight_NoEleMatch_woGwoGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_woGwoGSF_Barrel_BDTG.weights.xml";
  string Weight_NoEleMatch_woGwGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_woGwGSF_Barrel_BDTG.weights.xml";
  string Weight_NoEleMatch_wGwoGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_wGwoGSF_Barrel_BDTG.weights.xml";
  string Weight_NoEleMatch_wGwGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_wGwGSF_Barrel_BDTG.weights.xml";
  string Weight_woGwoGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_woGwoGSF_Barrel_BDTG.weights.xml";
  string Weight_woGwGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_woGwGSF_Barrel_BDTG.weights.xml";
  string Weight_wGwoGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_wGwoGSF_Barrel_BDTG.weights.xml";
  string Weight_wGwGSF_BL = "tmva/weights/V18/TMVAClassification_v18EleVeto_wGwGSF_Barrel_BDTG.weights.xml";
  string Weight_NoEleMatch_woGwoGSF_EC = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_woGwoGSF_Endcap_BDTG.weights.xml";
  string Weight_NoEleMatch_woGwGSF_EC = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_woGwGSF_Endcap_BDTG.weights.xml";
  string Weight_NoEleMatch_wGwoGSF_EC = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_wGwoGSF_Endcap_BDTG.weights.xml";
  string Weight_NoEleMatch_wGwGSF_EC = "tmva/weights/V18/TMVAClassification_v18EleVeto_NoEleMatch_wGwGSF_Endcap_BDTG.weights.xml";
  string Weight_woGwoGSF_EC = "tmva/weights/V18/TMVAClassification_v18EleVeto_woGwoGSF_Endcap_BDTG.weights.xml";
  string Weight_woGwGSF_EC = "tmva/weights/V18/TMVAClassification_v18EleVeto_woGwGSF_Endcap_BDTG.weights.xml";
开发者ID:inaranjo,项目名称:ElectronsStudies,代码行数:67,代码来源:AntiElectronMVAApplicationTest.C

示例5: minBiasJetSkim

void minBiasJetSkim(const TString configFile, const TString inputFile, const TString outputFile)
{
       std::cout<<"running minBiasJetSkim()"<<std::endl;
       std::cout<<"configFile  = "<< configFile.Data() <<std::endl;
       std::cout<<"inputFile   = "<< inputFile.Data() <<std::endl;
       std::cout<<"outputFile  = "<< outputFile.Data() <<std::endl;

       InputConfiguration configInput = InputConfigurationParser::Parse(configFile.Data());
       CutConfiguration configCuts = CutConfigurationParser::Parse(configFile.Data());

       if (!configInput.isValid) {
           std::cout << "Input configuration is invalid." << std::endl;
           std::cout << "exiting" << std::endl;
           return;
       }
       if (!configCuts.isValid) {
           std::cout << "Cut configuration is invalid." << std::endl;
           std::cout << "exiting" << std::endl;
           return;
       }

       // cut configuration
       float cut_vz = configCuts.proc[CUTS::kSKIM].obj[CUTS::kEVENT].f[CUTS::EVT::k_vz];
       int cut_pcollisionEventSelection = configCuts.proc[CUTS::kSKIM].obj[CUTS::kEVENT].i[CUTS::EVT::k_pcollisionEventSelection];

       std::vector<std::string> jetCollections = ConfigurationParser::ParseList(configCuts.proc[CUTS::kSKIM].obj[CUTS::kJET].s[CUTS::JET::k_jetCollection]);
       int nMaxEvents_minBiasMixing = configCuts.proc[CUTS::kSKIM].obj[CUTS::kGAMMAJET].i[CUTS::GJT::k_nMaxEvents_minBiasMixing];
       int nCentralityBins = configCuts.proc[CUTS::kSKIM].obj[CUTS::kGAMMAJET].i[CUTS::GJT::k_nCentralityBins];
       int nVertexBins = configCuts.proc[CUTS::kSKIM].obj[CUTS::kGAMMAJET].i[CUTS::GJT::k_nVertexBins];
       int nEventPlaneBins = configCuts.proc[CUTS::kSKIM].obj[CUTS::kGAMMAJET].i[CUTS::GJT::k_nEventPlaneBins];

       int nJetCollections = jetCollections.size();

       // verbose about cut configuration
       std::cout<<"Cut Configuration :"<<std::endl;
       std::cout<<"cut_vz = "<< cut_vz <<std::endl;
       std::cout<<"cut_pcollisionEventSelection = "<< cut_pcollisionEventSelection <<std::endl;

       std::cout<<"nJetCollections = "<< nJetCollections <<std::endl;
       for (int i=0; i<nJetCollections; ++i) {
           std::cout << Form("jetCollections[%d] = %s", i, jetCollections.at(i).c_str()) << std::endl;
       }
       std::cout<<"nMaxEvents_minBiasMixing = "<< nMaxEvents_minBiasMixing <<std::endl;
       std::cout<<"nCentralityBins          = "<< nCentralityBins <<std::endl;
       std::cout<<"nVertexBins              = "<< nVertexBins <<std::endl;
       std::cout<<"nEventPlaneBins          = "<< nEventPlaneBins <<std::endl;

       std::vector<std::string> inputFiles = InputConfigurationParser::ParseFiles(inputFile.Data());

       std::cout<<"input ROOT files : num = "<<inputFiles.size()<< std::endl;
       std::cout<<"#####"<< std::endl;
       for (std::vector<std::string>::iterator it = inputFiles.begin() ; it != inputFiles.end(); ++it) {
           std::cout<<(*it).c_str()<< std::endl;
       }
       std::cout<<"##### END #####"<< std::endl;

       TChain* treeHLT   = new TChain("hltanalysis/HltTree");
       TChain* treeEvent = new TChain("ggHiNtuplizer/EventTree");
       TChain* treeJets[nJetCollections];
       for (int i=0; i<nJetCollections; ++i) {
           treeJets[i] = new TChain(Form("%s/t", jetCollections.at(i).c_str()));
       }
       TChain* treeHiEvt = new TChain("hiEvtAnalyzer/HiTree");
       TChain* treeSkim  = new TChain("skimanalysis/HltTree");
       TChain* treeHiForestInfo = new TChain("HiForest/HiForestInfo");

       for (std::vector<std::string>::iterator it = inputFiles.begin() ; it != inputFiles.end(); ++it) {
          treeHLT->Add((*it).c_str());
          treeEvent->Add((*it).c_str());
          for (int i=0; i<nJetCollections; ++i) {
              treeJets[i]->Add((*it).c_str());
          }
          treeHiEvt->Add((*it).c_str());
          treeSkim->Add((*it).c_str());
          if (it == inputFiles.begin())  treeHiForestInfo->Add((*it).c_str());
       }

       HiForestInfoController hfic(treeHiForestInfo);
       std::cout<<"### HiForestInfo Tree ###"<< std::endl;
       hfic.printHiForestInfo();
       std::cout<<"###"<< std::endl;

       treeHLT->SetBranchStatus("*",0);     // disable all branches

       treeEvent->SetBranchStatus("*",0);
       treeEvent->SetBranchStatus("run",1);
       treeEvent->SetBranchStatus("event",1);
       treeEvent->SetBranchStatus("lumis",1);

       for (int i=0; i<nJetCollections; ++i) {
           treeJets[i]->SetBranchStatus("*",0);        // disable all branches
           treeJets[i]->SetBranchStatus("nref",1);     // enable jet branches
           treeJets[i]->SetBranchStatus("rawpt",1);    // enable jet branches
           treeJets[i]->SetBranchStatus("jtpt",1);     // enable jet branches
           treeJets[i]->SetBranchStatus("jteta",1);    // enable jet branches
           treeJets[i]->SetBranchStatus("jtphi",1);    // enable jet branches
           treeJets[i]->SetBranchStatus("jty",1);      // enable jet branches
           treeJets[i]->SetBranchStatus("jtpu",1);     // enable jet branches
           treeJets[i]->SetBranchStatus("jtm",1);      // enable jet branches
           treeJets[i]->SetBranchStatus("track*",1);
//.........这里部分代码省略.........
开发者ID:CmsHI,项目名称:ElectroWeak-Jet-Track-Analyses,代码行数:101,代码来源:minBiasJetSkim.C

示例6: main

int main(int argc, char *argv[]){
  
  char DFin_location[256];
  DFin_location = argv[1] ;
  char DFout_location[256] argv[2];
  char AnaFile[256] = argv[3] ;
  char SimFile[256] = argv[4] ;
  int TriggerBucket = atoi(argv[5]);
  int RUN = atoi(argv[5]);

  std::cout << argv[1] << std::endl;  
  std::cout << DFin_location << std::endl;

  return;



  //here goes the first file
  TChain * DFinput = new TChain("Telescope");
  DFinput->Add(DFin_location);

  unsigned int Event_in;
  int roc_in;
  int col_in,row_in,vcal_in;
  float flux_in;
  double pulseHeight_in;
  std::cout << roc_in << std::endl;

  DFinput->SetBranchStatus("*",false);

  DFinput->SetBranchStatus("Event",true);
  DFinput->SetBranchStatus("roc",true);
  DFinput->SetBranchStatus("pulseHeight",true);
  DFinput->SetBranchStatus("vcal",true);
  DFinput->SetBranchStatus("col",true);
  DFinput->SetBranchStatus("row",true);
  DFinput->SetBranchStatus("flux",true);

  DFinput->SetBranchAddress("Event",&Event_in);
  DFinput->SetBranchAddress("roc",&roc_in);
  DFinput->SetBranchAddress("row",&row_in);
  DFinput->SetBranchAddress("col",&col_in);
  DFinput->SetBranchAddress("vcal",&vcal_in);
  DFinput->SetBranchAddress("flux",&flux_in);
  DFinput->SetBranchAddress("pulseHeight",&pulseHeight_in);

  std::cout << "Loaded DF input file from: " << DFin_location << std::endl;


  //here goes the second file
  TChain * DFoutput = new TChain("hitTree");
  DFoutput->Add(DFout_location);

  unsigned int event_number;
  int roc_out,col_out,row_out,vcal_out;
  double pulseHeight_out;
  long TS_out;


  DFoutput->SetBranchStatus("*",false);

  DFoutput->SetBranchStatus("event_number",true);
  DFoutput->SetBranchStatus("TS",true);
  DFoutput->SetBranchStatus("roc",true);
  DFoutput->SetBranchStatus("col",true);
  DFoutput->SetBranchStatus("row",true);
  DFoutput->SetBranchStatus("vcal",true);
  DFoutput->SetBranchStatus("pulseHeight",true);


  DFoutput->SetBranchAddress("event_number",&event_number);
  DFoutput->SetBranchAddress("TS",&TS_out);
  DFoutput->SetBranchAddress("roc",&roc_out);
  DFoutput->SetBranchAddress("col",&col_out);
  DFoutput->SetBranchAddress("row",&row_out);
  DFoutput->SetBranchAddress("vcal",&vcal_out);
  DFoutput->SetBranchAddress("pulseHeight",&pulseHeight_out);

  std::cout << "Loaded DF output file from: " << DFout_location << std::endl;

  //here come the analysis files
  //comes later


  //here come the original run data files



  //Now we make some histograms we want to compare


  TCanvas * c1 = new TCanvas("Comparison","Comparison",1200,1200);
  // gStyle->SetOptStat(0);
  c1->Divide(2,2);

  c1->cd(1);



  TH1I * Pixels_per_Event_in = new TH1I("Pixels per Event", "DataFlow input",20,0,20);
//.........这里部分代码省略.........
开发者ID:akornmay,项目名称:usercode,代码行数:101,代码来源:comparison_compile.cpp


注:本文中的TChain::SetBranchStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。