Hi,
I found a very strange behaviour in Root 5.26 and I was wondering if it could be a bug.
This is my problem:
the plot of trackx.m*-5400+trackx.q-gCMSLGcl.geoposX is different from -gCMSLGcl.geoposX+trackx.m*-5400+trackx.q so it means that it depends on the position.
How is it possible?
This is the code I’m using for that:
#include “TTree.h”
#include “TFile.h”
#include “TRandom.h”
#include “TTree.h”
#include “TTree.h”
#include “TCanvas.h”
#include “TStyle.h”
#include “TH1.h”
#include “TH2.h”
#include “TGaxis.h”
#include “TMath.h”
#include “TAxis.h”
#include “TArrayD.h”
void Spatial_Reso_friends_mini() {
gROOT->SetStyle(“Plain”);
TFile *f1 = TFile::Open(“Run0117_800uA_lat20_thr20_MPSL1/CRC-Run0117_800uA_lat20_thr20_MPSL1-120714_105217-0.root”);
TTree *tree = new TTree(“T”,“An example of ROOT tree with a few branches”);
tree->AddFriend(“rd51tbgeo”,“Run0117_800uA_lat20_thr20_MPSL1/CRC-Run0117_800uA_lat20_thr20_MPSL1-120714_105217-0.root”);
tree->AddFriend(“trackertree”,“Run0117_800uA_lat20_thr20_MPSL1/RECO-CRC-Run0117_800uA_lat20_thr20_MPSL1-120714_105217-0.root”);
TCanvas *c = new TCanvas(“c”,“canvas”,600,600);
TH1F h1 = new TH1F(“h1”,"trackx.m-5400+trackx.q-gCMSLGcl.geoposX",200,-20,20);
TH1F h2 = new TH1F(“h2”,"-gCMSLGcl.geoposX+trackx.m-5400+trackx.q",200,-20,20);
c->Divide(2,1);
c->cd(1);
h1->SetLineColor(4);
h1->SetLineWidth(2);
tree->Draw(“trackx.m*-5400+trackx.q-gCMSLGcl.geoposX>>h1”,"");
c->cd(2);
h2->SetLineColor(4);
h2->SetLineWidth(2);
tree->Draw("-gCMSLGcl.geoposX+trackx.m*-5400+trackx.q>>h2","");
}
In attach I put both final plots.
Cheers
c.pdf (17 KB)