Exemple #1
0
void
GlidePolarTest::Run()
{
  Init();
  TestBasic();
  TestBallast();
  TestBugs();
  TestMC();
}
Exemple #2
0
int main(){

  MVariable* TestVar = new MVariable("Lambda_b0_MM",F,none);
  MVariable* KaonPT= new MVariable("Kaon_PT",F,none);
  MVariable* ProtonPT= new MVariable("Proton_PT",F,none);

  MultiVariable* PTs = new MultiVariable("PTs",sum);
  PTs->AddVariable(KaonPT);
  PTs->AddVariable(ProtonPT);
  
  //  MultiVariable* TestMulti = new MultiVariable("PTs",sum);
  //  TestMulti->AddVariable("Kaon_PT",F,none);
  //  TestMulti->AddVariable("proton_PT",F,none);
  
  std::cout<<TestVar->GetBranchName()<<std::endl;
  std::cout<<TestVar->GetType()<<std::endl;
  std::cout<<TestVar->GetFactoryName()<<std::endl;

  std::cout<<PTs->GetBranchName()<<std::endl;
  std::cout<<PTs->GetType()<<std::endl;
  std::cout<<PTs->GetFactoryName()<<std::endl;

  
  DataFile TestMC(std::getenv("LBPKETAPETAMCROOT"),MC,Twel,MagAll,lbpketapeta,"TriggerCut");
  TFile* TestFile = new TFile((TestMC.GetFP()).data());
  TTree* TestTree= (TTree*)TestFile->Get("DecayTree");

  bool branchsetsuccess=TestVar->SetBA(TestTree);
  if(!branchsetsuccess){
    std::cout<<" A Branch was not set succesfully"<<std::endl;
    return 1;
  }

  branchsetsuccess =PTs->SetBA(TestTree);
  if(!branchsetsuccess){
    std::cout<<"A Branch was not set successfully"<<std::endl;
    return 1;
  }
  
  for(int i=0;i<10;++i){
    TestTree->GetEntry(i);
    TestVar->DoOperation();
    Double_t* DataAddress=TestVar->GetDataAddress();
    Float_t* ReaderAddress=TestVar->GetReaderAddress();
    std::cout<<*DataAddress<<std::endl;
    std::cout<<*ReaderAddress<<std::endl;
    PTs->DoOperation();
    Double_t* DataPT = PTs->GetDataAddress();
    Float_t* ReaderPT = PTs->GetReaderAddress();
    std::cout<<"Data pt= "<<*DataPT<<std::endl;
    std::cout<<"Reader pt = "<<*ReaderPT<<std::endl;
  }
  



}