-- AgneseBonavita - 2017-06-15

  • Initial Commands
  • Web Page
  • How to enter in galilinux
  • #HowToEnterInCMSAnalysis[HowToEnterInCMSAnalysis]
  • TLorenzVector
  • Helpful links
  • Initial Commands

    cd private/tesi/CMSSW_8_0_28/src/code
    cmsenv
    g++ ./plotter_vbfzll.C -g -o plot `root-config --cflags --glibs`   -lMLP -lXMLIO -lTMVA
    source run_AllPlots.sh
    cd histoFileDir
    source hadd_histos.sh
    cd ../plotCode
    source plot_nopas
    

    sftp://abonavit@lxplus.cern.ch
    
    Compile studiojet.C:
    g++ studiojet.C -g -o macro `root-config --cflags --glibs` -lMLP -lXMLIO
    

    Per leggere un file root su una macro diversa

    TFile * file = new TFile("/afs/cern.ch/user/a/abonavit/private/tesi/training/CMSSW_8_0_28/src/training/TMVA-v4.2.0/test/output/TMVA_main_v25_Np1_nomoremuaxis2jet2q.root");

    TTree tree = (TTree)file->Get("TestTree");

    int nentries = tree->GetEntries();

    Indentation 1

    Command description
    echo something print something. It is equivalent to echo "something"
    source file ...

    Indentation 2

    sftp://abonavit@lxplus.cern.ch/afs/cern.ch/user/a/abonavit/private/

    How to enter in galilinux

    ssh -XY bonavita@galilinuxNOSPAMPLEASE.pi.infn.it

    How to enter in gridui

    ssh -XY bonavita@gridui1NOSPAMPLEASE.pi.infn.it
    ssh -XY bonavita@gridui2NOSPAMPLEASE.pi.infn.it

    Type in
    • source /afs/pi.infn.it/grid_exp_sw/cms/scripts/setcms.(c)sh
    • setenv SCRAM_ARCH slc6_amd64_gcc492

    How to enter in cmsanalysis

    per entrare da terminale scrivere:
    ssh bonavita@galilinux
    ssh cmsanalysis

    Type in
    dopodichè per poter accedere alle cartelle su un altro termianle digitare: ssh -f -N -XY -L2223:cmsanalysis:22 bonavita@galilinuxNOSPAMPLEASE.pi.infn.it
    ssh -XY bonavita@localhost -p2223

    a quel punto andare sulle cartelle e digitare il seguente percorso: sftp://bonavita@localhost:2223/scratch/bonavita

    Change architecture

    setenv SCRAM_ARCH slc6_amd64_gcc491
    export SCRAM_ARCH=slc6_amd64_gcc491

    Array in PyRoot

    from ROOT import *
    from array import array
    bin = [1,2,3,4,5]
    histo= TH1D("histo", "histoTitle", len(binX)-1, array('d',binX))         #'d' stay for 'double'
    

    Web Page

    cp   *.png    /afs/cern.ch/user/g/gimandor/www/plotAgnese/Hmumu/primiPlot
    
    Plots are http://gimandor.web.cern.ch/gimandor/plotAgnese/Hmumu/

    #Root commands

    Root commands

    mode="div" showlink="show the code" hidelink="Hide the code" showimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleopen-small.gif" hideimgleft="/twiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif" class="twikiHelp" }%

    TRANSFORM A STRING IN A CHAR
    ex.
    variables_names (is a string)
    variables_names.c_str() (is a char)
    
    
    Open a Tree from terminal
    filename.root
    TTree *t=(TTree*)_file0->Get("TMVA")
    
    To open more root files in the same terminal
    root -l bkg.root ../JuneFile/tmva_tree_Bkg_v25mu.root  (basta separare i due file con  ../)
    
    hadd -f bkg.root main_tmva_tree_DY0JetsToLL_M_v25mu_QCDScalenom_JESnom.root main_tmva_tree_DY1JetsToLL_M_v25mu_QCDScalenom_JESnom.root main_tmva_tree_DY2JetsToLL_M_v25mu_QCDScalenom_JESnom.root main_tmva_tree_DY3JetsToLL_M_v25mu_QCDScalenom_JESnom.root main_tmva_tree_DY4JetsToLL_M_v25mu_QCDScalenom_JESnom.root main_tmva_tree_TT_v25mu_QCDScalenom_JESnom.root
    
    
    </>

    TLorenzVector

    TLorentzVector TLV;
    TLorentzVector TLV;
    
    TLV.SetPxPyPzE(px, py, pz, e)
    TLV.SetPtEtaPhiM(pt, eta, phi, m)
    
    theta = TLV.Theta();
    cost = TLV.CosTheta();
    phi = TLV.Phi();
    eta = TLV.PseudoRapidity () 
    m2 = TLV.Mag2()         = TLV.M2();
    m  = TLV.Mag()           = TLV.M();
    s  = TLV1*TLV2;           = v1.Dot(v2);     
    
    TVector3 v = TLV.Vect()
    

    Helpful links

    Edit | Attach | Watch | Print version | History: r19 < r18 < r17 < r16 < r15 | Backlinks | Raw View | WYSIWYG | More topic actions
    Topic revision: r19 - 2018-03-23 - AgneseBonavita
     
      • Cern Search Icon Cern Search
      • TWiki Search Icon TWiki Search
      • Google Search Icon Google Search

      Sandbox All webs login

    This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
    Ideas, requests, problems regarding TWiki? Send feedback