MUST2 SAMURAI_2018 S3-LEB-LPC SUPERNEMO MUGAST EXPAND SCALP GALATRON HiCARI VELO
  MUGAST  Not logged in MUGAST
Message ID: 4230     Entry time: Mon Apr 15 01:57:08 2019
Author: iulian Jaromir Valerian 
ExpNbr: e744s 
Type: VAMOS 
Category: Hardware 
Status: Fixed 
Target-Source: N/A 
Subject: Vamos efficiency 125_0 
to obtain it:
>lpcgrit
>npp mugast
>root offline/root_vamos/run_xxx.root
root [1] .L macros/EffCheck.C
root [2] EffChechk()
================== Time split version of scripts: ~/analysis/nptool/Projects/MUGAST/macros/EffCheck.C
==== guesses an hour length, works for 122, 125
==== see the output bellow
==== modified code in attachment

Forward (condition by before)
IC 0 92.7121%
IC 1 93.4805%
IC 2 93.6874%
IC 3 95.111%
----------------------
Backward (condition by after)
IC 1 93.7834%
IC 2 93.8809%
IC 3 92.1641%
IC 4 91.0911%
----------------------
DC (condition by IC[0])
DC WIRE 0 89.3256%
DC WIRE 1 89.5065%
DC WIRE 2 88.2744%
DC WIRE 3 91.7775%
----------------------
DC X (condition by IC[0])
DCX0 81.3829%
DCX1 81.3837%
DCX2 83.0758%
DCX3 82.449%
----------------------
Xf (condition by IC[0])
Xf 72.9503%
----------------------



root [3] .x macros/EffCheck.C
============================================================
offline/root_vamos/run_0125_0.root
============================================================
Looking for min and max time stamp... very slow
min 5645191654671913001
max 5746769951007854244
delta 101578296335941243
delta 4.3 hours EMPIRICAL RUN LENGHT
1hour==23622862570130036



=========================================================
i... HOUR: 2
Forward (condition by before)
IC 0 92.9316%
IC 1 93.7101%
IC 2 93.8214%
IC 3 95.3857%
----------------------------
Backward (condition by after)
IC 1 93.9656%
IC 2 93.9186%
IC 3 92.1004%
IC 4 91.0845%
----------------------------
DC (condition by IC[0])
DC WIRE 0 90.7057%
DC WIRE 1 90.8913%
DC WIRE 2 89.7104%
DC WIRE 3 92.1789%
----------------------------
DC X (condition by IC[0])
DCX0 82.8504%
DCX1 82.9172%
DCX2 84.0074%
DCX3 83.3231%
----------------------------
Xf (condition by IC[0])
Xf 74.9742%
----------------------------

=========================================================
i... HOUR: 4
Forward (condition by before)
IC 0 92.6848%
IC 1 93.4008%
IC 2 93.6383%
IC 3 94.9419%
----------------------------
Backward (condition by after)
IC 1 93.6902%
IC 2 93.8594%
IC 3 92.1954%
IC 4 91.0825%
----------------------------
DC (condition by IC[0])
DC WIRE 0 88.811%
DC WIRE 1 89.0412%
DC WIRE 2 87.7612%
DC WIRE 3 91.4577%
----------------------------
DC X (condition by IC[0])
DCX0 80.8638%
DCX1 80.7706%
DCX2 82.6961%
DCX3 82.0982%
----------------------------
Xf (condition by IC[0])
Xf 72.2419%
----------------------------

=========================================================
i... HOUR: 6
Forward (condition by before)
IC 0 92.3355%
IC 1 93.4695%
IC 2 93.5595%
IC 3 95.0589%
----------------------------
Backward (condition by after)
IC 1 93.8846%
IC 2 93.8857%
IC 3 92.1605%
IC 4 91.2521%
----------------------------
DC (condition by IC[0])
DC WIRE 0 88.2688%
DC WIRE 1 88.3611%
DC WIRE 2 87.006%
DC WIRE 3 91.6316%
----------------------------
DC X (condition by IC[0])
DCX0 79.9095%
DCX1 80.0215%
DCX2 82.2048%
DCX3 81.5886%
----------------------------
Xf (condition by IC[0])
Xf 71.1065%
----------------------------
root [4]
Attachment 1: EffCheck.C  3 kB  Uploaded Mon Apr 15 08:34:05 2019  | Hide | Hide all

void chkef( ULong64_t low, ULong64_t high,   ULong64_t n ){
  cout<<endl;
  cout<< "=========================================================\n" ;
  cout<<"i... HOUR: "<<n<<endl; //"     "<<low<<" "<<high<<endl;
  string sep = "----------------------------\n" ;



  TTree *t1 = (TTree*) gROOT->FindObject("AD");

  TH1F * hc = new TH1F("hc","hc",2000,0.1,50);
  TH1F * ht = new TH1F("ht","ht",2000,0.1,50);


  TString cond=  Form("(((RTS<<32)+(VTS<<16)+LTS)>=%lld)&&(((RTS<<32)+(VTS<<16)+LTS)<%lld)",low,high);
  TString condad=Form("&&( (((RTS<<32)+(VTS<<16)+LTS)>=%lld)&&(((RTS<<32)+(VTS<<16)+LTS)<%lld) )",low,high);


  // cout<<cond<<endl<<condad<<endl;


      cout << "Forward (condition by before)" << endl; 
  for(int i =0; i<4;i++)
    {
      t1->Draw(Form("IC[%d]>>ht",i+1),cond.Data() ,"goff");
      t1->Draw(Form("IC[%d]>>hc",i+1),Form("IC[%d]>0.1 %s",i,condad.Data() ),"goff");
      cout << "IC " << i << " " << hc->Integral()/ht->Integral()*100. << "%"<< endl;

    }

  cout << sep ;


  cout << "Backward  (condition by after)" << endl; 

  for(int i =0; i<4;i++)
    {
      t1->Draw(Form("IC[%d]>>ht",i),cond.Data() ,"goff");
      t1->Draw(Form("IC[%d]>>hc",i),Form("IC[%d]>0.1 %s",i+1,  condad.Data() ),"goff");
      cout << "IC " << i+1 << " " << hc->Integral()/ht->Integral()*100. << "%"<< endl;

    }
cout << sep ;

 cout << "DC  (condition by IC[0])" << endl; 

  for(int i =0; i<4;i++)
    {
      t1->Draw(Form("IC[0]>>ht"),cond.Data(),"goff");
      t1->Draw(Form("IC[0]>>hc"),Form("EWIRE_%d>100 %s",i, condad.Data() ),"goff");
      cout << "DC WIRE " << i << " " << hc->Integral()/ht->Integral()*100. << "%"<< endl;

    }
cout << sep ;

cout << "DC X  (condition by IC[0])" << endl; 

  for(int i =0; i<4;i++)
    {
      t1->Draw(Form("IC[0]>>ht"),cond.Data(),"goff");
      t1->Draw(Form("IC[0]>>hc"),Form("DC%d_X>-1500  %s",i, condad.Data() ),"goff");
      cout << "DCX" << i << " " << hc->Integral()/ht->Integral()*100. << "%"<< endl;

    }

cout << sep ;


cout << "Xf  (condition by IC[0])" << endl; 

      t1->Draw(Form("IC[0]>>ht"),cond.Data() ,"goff");
      t1->Draw(Form("IC[0]>>hc"),Form("Xf>-1500 %s", condad.Data() ),"goff");
      cout << "Xf " << hc->Integral()/ht->Integral()*100. << "%"<< endl;


cout << sep ;


 delete hc;
 delete ht;
}



/*
ORIGINAL NAME but  now the original code for VAMOS eff is above
 */
void EffCheck()
{

  ULong64_t hour;
  ULong64_t LTSmin=-1;
  ULong64_t LTSmax=-1;
  ULong64_t LTS,VTS,RTS, tmin,tmax,tmp;
 
  cout<< "============================================================\n" ;
  cout<<"          "<<gFile->GetName()<<endl;
  cout<< "============================================================\n" ;


  cout<<"Looking for min and max time stamp... very slow"<<endl;
  TTree *tree= (TTree*)gDirectory->Get("AD");
  tree->SetBranchAddress("LTS",&LTS);
  tree->SetBranchAddress("VTS",&VTS);
  tree->SetBranchAddress("RTS",&RTS);
  
  
 for (int i=1;i<tree->GetEntries();i++){
   tree->GetEntry(i);
   tmp=(RTS<<32)+(VTS<<16)+LTS;
   if ((LTS>0)&&(tmp>1e+14)){  //================== kill some low values?
     if ((LTSmin>tmp) || (LTSmin==-1)){
       LTSmin=tmp;
     }
     if ((LTSmax<tmp) || (LTSmax==-1)){
       LTSmax=tmp;
     }
   }
 }


 //tree->Draw("(RTS<<32)+(VTS<<16)+LTS>>h(10000)","","");
 //  Long64_t LTSmin=AD->GetV1()[0];
 //  AD->Draw("RTS<<32+VTS<<16+LTS","LTS>0","goff", 1, AD->GetEntries()-1 );
 //  Long64_t LTSmax=AD->GetV1()[0];
 cout<<"min    "<<LTSmin<<" "<<endl;
 cout<<"max    "<<LTSmax<<" "<< endl;
 cout<<"delta  "<<LTSmax-LTSmin<<endl;
 cout<<"delta  "<<(LTSmax-LTSmin)/100/1e+6/3600/282162*4.3<<" hours  EMPIRICAL RUN LENGHT"<<endl;
 hour=143567947269965277/6.0775;
 cout<<"1hour=="<<hour<<endl<<endl<<endl;
 //==========================================================================================

 ULong64_t n=0;
 int hourstep=2;
 for (ULong64_t i=LTSmin; i<LTSmax; i+=hour*hourstep){
   n=n+1;
   chkef( i, i+hour , n*hourstep);
 }

  return NULL;




}

ELOG Home Page