Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
calorimeters.C File Reference

Detailed Description

Demonstrates usage of EVE calorimetry classes.

#include "TFile.h"
#include "TGeoTube.h"
const char *histFile = "http://root.cern/files/cms_calo_hist.root";
const Double_t kR_min = 128;
const Double_t kR_max = 129;
const Double_t kZ_d = 268.39;
using namespace ROOT::Experimental;
{
auto geomScene = eveMng->SpawnNewScene(Form("%s Geometry", pname), pname);
auto eventScene = eveMng->SpawnNewScene(Form("%s Event Data", pname), pname);
auto mng = new REveProjectionManager();
mng->SetProjection(t);
// project Calo3D
REveCalo2D *calo2d = (REveCalo2D *)mng->ImportElements(calo3d, eventScene);
// project reference geometry
REveElement *geo2d = mng->ImportElements(eveMng->GetGlobalScene()->FirstChild(), geomScene);
auto view = eveMng->SpawnNewViewer("RPhi View", "");
view->SetCameraType(REveViewer::kCameraOrthoXOY);
view->AddScene(geomScene);
view->AddScene(eventScene);
}
void add_jet(REveElement *parent, const char *name, Float_t eta, Float_t phi, Float_t deta, Float_t dphi)
{
auto jet = new REveJetCone(name, name);
jet->SetMainTransparency(60);
jet->SetLineColor(kRed);
jet->SetCylinder(kR_min - 10, kZ_d - 10);
jet->AddEllipticCone(eta, phi, deta, dphi);
jet->SetPickable(kTRUE);
jet->SetHighlightFrame(kFALSE);
parent->AddElement(jet);
}
{
auto eveMng = REveManager::Create();
auto hf = TFile::Open(histFile, "CACHEREAD");
auto ecalHist = (TH2F *)hf->Get("ecalLego");
auto hcalHist = (TH2F *)hf->Get("hcalLego");
auto data = new REveCaloDataHist();
data->AddHistogram(ecalHist);
data->RefSliceInfo(0).Setup("ECAL", 0.f, kBlue);
data->AddHistogram(hcalHist);
data->RefSliceInfo(1).Setup("HCAL", 0.1, kRed);
eveMng->GetEventScene()->AddElement(data);
auto b1 = new REveGeoShape("Barrel 1");
b1->SetShape(new TGeoTube(kR_min, kR_max, kZ_d));
b1->SetMainColor(kCyan);
b1->SetMainTransparency(90);
b1->SetNSegments(80);
eveMng->GetGlobalScene()->AddElement(b1);
auto calo3d = new REveCalo3D(data);
calo3d->SetBarrelRadius(kR_max + 1);
calo3d->SetEndCapPos(kZ_d + 1);
calo3d->SetMaxTowerH(300);
eveMng->GetEventScene()->AddElement(calo3d);
add_jet(calo3d, "JetCone Lojz", 1.4, 1.0, 0.4, 0.2);
add_jet(calo3d, "JetCone Mici", -2.0, -2.1, 0.2, 0.4);
makeCalo2D(calo3d, "RPhi", REveProjection::kPT_RPhi);
makeCalo2D(calo3d, "RhoZ", REveProjection::kPT_RhoZ);
eveMng->Show();
}
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
@ kRed
Definition Rtypes.h:67
@ kCyan
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
char name[80]
Definition TGX11.cxx:148
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2570
Visualization of a calorimeter event data in 2D.
Visualization of a calorimeter event data in 3D.
A central manager for calorimeter data of an event written in TH2F.
Base class for REveUtil visualization elements, providing hierarchy management, rendering control and...
Wrapper for TGeoShape with absolute positioning and color attributes allowing display of extracted TG...
Draws a jet cone with leading particle is specified in (eta,phi) and cone radius is given.
Manager class for steering of projections and managing projected objects.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Definition TFile.cxx:3797
static Bool_t SetCacheFileDir(std::string_view cacheDir, Bool_t operateDisconnected=kTRUE, Bool_t forceCacheread=kFALSE)
Sets the directory where to locally stage/cache remote files.
Definition TFile.cxx:4338
Cylindrical tube class.
Definition TGeoTube.h:17
2-D histogram with a float per channel (see TH1 documentation)
Definition TH2.h:345
Namespace for ROOT features in testing.
Definition TROOT.h:100
R__EXTERN REveManager * gEve
Author
Alja Mrak-Tadel

Definition in file calorimeters.C.