diff --git a/tutorial/pages/genealogy.md b/tutorial/pages/genealogy.md index 11b3db9..dd7ecf7 100644 --- a/tutorial/pages/genealogy.md +++ b/tutorial/pages/genealogy.md @@ -47,7 +47,8 @@ c1->SetGridy(true); Now we can draw the X-Z starting position of the conversion electrons like this: ``` - trkana->Draw("demmcsim.pos.x():demmcsim.pos.z()>>hist(1000,-20000,1000, 1000,-700,9000)", "demmcsim.prirel._rem==1 && demmcsim.prirel._rel==2", "COLZ"); + TH2D* hist = new TH2D("hist", "", 1000,-20000,1000, 1000,-700,9000); + trkana->Draw("demmcsim.pos.x():demmcsim.pos.z()>>hist", "demmcsim.prirel._rem==1 && demmcsim.prirel._rel==2", "COLZ"); ``` where ```prirel._rel==2``` is for parent. You should see the S-bend of the transport solenoid and also the production solenoid. diff --git a/tutorial/pages/mom-res.md b/tutorial/pages/mom-res.md index a3099fd..fc1eb70 100644 --- a/tutorial/pages/mom-res.md +++ b/tutorial/pages/mom-res.md @@ -47,7 +47,8 @@ c1->SetGridy(true); We can first plot the reconstructed momentum and the MC truth information separately: ``` -trkana->Draw("demfit.mom.R()>>hist(100,100,110)", "demfit.sid==0", "HIST"); +TH1D* hist = new TH1D("hist", "", 100,100,110)); +trkana->Draw("demfit.mom.R()>>hist", "demfit.sid==0", "HIST"); trkana->Draw("demmcvd.mom.R()>>hist2", "demmcvd.sid==0", "HIST SAMES"); ``` diff --git a/tutorial/pages/n-hits.md b/tutorial/pages/n-hits.md index 516d346..a66acc6 100644 --- a/tutorial/pages/n-hits.md +++ b/tutorial/pages/n-hits.md @@ -58,7 +58,8 @@ c1->SetGridy(true); We can then plot a histogram of the number of hits on each track like so: ``` -trkana->Draw("dem.nhits>>hist(100,0,100)", "", "goff"); +TH1D* hist = new TH1D("hist", "", 100,0,100) +trkana->Draw("dem.nhits>>hist", "", "goff"); ``` where ```goff``` is the drawing option to now draw since we are still missing some important information: axis labels diff --git a/tutorial/pages/reco-mom.md b/tutorial/pages/reco-mom.md index fb44b9c..e01d6f9 100644 --- a/tutorial/pages/reco-mom.md +++ b/tutorial/pages/reco-mom.md @@ -89,7 +89,8 @@ We want to plot the momentum of the tracks. If you ```Print()``` the ```demfit`` We want to plot the magnitude of the momentum vector. We could calculate it ourselves from the components but in ROOT, we can use member functions of [XYZVectorF](https://root.cern.ch/doc/v628/namespaceROOT_1_1Math.html#a767e8c52a85dc9538fe00603961eab98). We will use ```R()``` function: ``` -trkana->Draw("demfit.mom.R()>>hist(100,100,110)", "", "HIST"); +TH1D* hist = new TH1D("hist", "", 100,100,110") +trkana->Draw("demfit.mom.R()>>hist, "", "HIST"); ``` You may notice that the peak is rather broad... That's because we are plotting the reconstructed track momentum at all the intersections - the entrance, middle, and exit of the tracker. @@ -97,7 +98,7 @@ You may notice that the peak is rather broad... That's because we are plotting t To see just the track momentum at one of the intersections, we need to apply a cut using the second argument to the ```Draw()``` function: ``` -trkana->Draw("demfit.mom.R()>>hist(100,100,110)", "demfit.sid==0", "HIST") +trkana->Draw("demfit.mom.R()>>hist", "demfit.sid==0", "HIST") ``` where ```sid``` is the surface id of the intersection we want to plot (```sid=0``` is the entrance to the tracker). diff --git a/tutorial/pages/start-pos.md b/tutorial/pages/start-pos.md index e704586..d5ea154 100644 --- a/tutorial/pages/start-pos.md +++ b/tutorial/pages/start-pos.md @@ -54,7 +54,8 @@ c1->SetGridy(true); Now we can draw the X-Y starting position of the conversion electrons like this: ``` - trkana->Draw("demmcsim.pos.y():demmcsim.pos.x()>>hist(200,-100,100, 200,-100,100)", "demmcsim.prirel._rem==0", "COLZ"); + TH2D* hist = new TH2D("hist", "", 100-100,100, 200,-100,100) + trkana->Draw("demmcsim.pos.y():demmcsim.pos.x()>>hist", "demmcsim.prirel._rem==0", "COLZ"); ``` where ```COLZ``` tells ROOT to draw with a color map. Note that the coordinate system used by TrkAna is the detector coordinate system (origin = center of tracker) and not the global Mu2e coordinate system (origin = center of TS3).