47 -5.191, -4.889, -4.716, -4.538, -4.363, -4.191, -4.013, -3.839, -3.664, -3.489, -3.314, -3.139, -2.964, -2.853,
48 -2.650, -2.500, -2.322, -2.172, -2.043, -1.930, -1.830, -1.740, -1.653, -1.566, -1.479, -1.392, -1.305, -1.218,
49 -1.131, -1.044, -0.957, -0.870, -0.783, -0.696, -0.609, -0.522, -0.435, -0.348, -0.261, -0.174, -0.087, 0.000,
50 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870, 0.957, 1.044, 1.131, 1.218,
51 1.305, 1.392, 1.479, 1.566, 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.853,
52 2.964, 3.139, 3.314, 3.489, 3.664, 3.839, 4.013, 4.191, 4.363, 4.538, 4.716, 4.889, 5.191};
76 :
TParticle(pdg, status, mother1, mother2, daughter1, daughter2, px, py, pz, etot, 0, 0, 0, 0)
118 std::set<int> item_set;
120 for (
auto &cellId : sel_cells) {
124 for (
int t = 0; t <
fCollection->GetNItems(); ++t) {
126 if (tower->
fEta > cd.fEtaMin && tower->
fEta < cd.fEtaMax && tower->
fPhi > cd.fPhiMin &&
127 tower->
fPhi < cd.fPhiMax &&
fCollection->GetDataItem(t)->GetVisible()) {
133 fCollection->GetItemList()->RefSelectedSet() = item_set;
143 for (
auto &i : idcs) {
148 for (
size_t ci = 0; ci < out.size(); ++ci) {
149 if (out[ci].fTower == bin && out[ci].fSlice ==
GetSliceIndex()) {
150 float oldv = out[ci].fFraction;
151 out[ci].fFraction = oldv + frac;
189 list->SetName(
"Jets");
190 for (
int i = 1; i <=
N; ++i) {
191 double pt =
r.Uniform(0.5, 10);
192 double eta =
r.Uniform(-2.55, 2.55);
195 double px =
pt * std::cos(phi);
196 double py =
pt * std::sin(phi);
197 double pz =
pt * (1. / (std::tan(2 * std::atan(std::exp(-eta)))));
199 auto jet =
new Jet(0, 0, 0, 0, 0, 0, px, py, pz, std::sqrt(px * px + py * py + pz * pz + 80 * 80));
200 jet->SetEtaSize(
r.Uniform(0.02, 0.2));
201 jet->SetPhiSize(
r.Uniform(0.01, 0.3));
212 list->SetName(
"Tracks");
213 for (
int i = 1; i <=
N; ++i) {
214 double pt =
r.Uniform(0.5, 10);
215 double eta =
r.Uniform(-2.55, 2.55);
218 double px =
pt * std::cos(phi);
219 double py =
pt * std::sin(phi);
220 double pz =
pt * (1. / (std::tan(2 * std::atan(std::exp(-eta)))));
224 new TParticle(0, 0, 0, 0, 0, 0, px, py, pz, std::sqrt(px * px + py * py + pz * pz + 80 * 80), 0, 0, 0, 0);
226 int pdg = 11 * (
r.Integer(2) > 0 ? 1 : -1);
227 particle->SetPdgCode(pdg);
239 list->SetName(
"RecHits");
241 for (
int i = 1; i <=
N; ++i) {
242 float pt =
r.Uniform(0.5, 10);
243 float x =
r.Uniform(-200, 200);
244 float y =
r.Uniform(-200, 200);
245 float z =
r.Uniform(-500, 500);
274 for (
int i = 0; i <= jlist->
GetLast(); ++i) {
276 float offX = j->
Eta();
278 for (
int k = 0; k < 20; ++k) {
309 jet->SetLineColor(jet->GetMainColor());
311 float size = 50.f * dj.
Pt();
312 double theta = dj.
Theta();
314 double phi = dj.
Phi();
316 if (viewType ==
"Projected") {
317 static const float_t offr = 6;
318 float r_ecal = context->
GetMaxR() + offr;
319 float z_ecal = context->
GetMaxZ() + offr;
321 float transAngle = abs(atan(r_ecal / z_ecal));
324 if (theta < transAngle || 3.14 - theta < transAngle) {
325 z_ecal = context->
GetMaxZ() + offr / transAngle;
326 r = z_ecal / fabs(cos(theta));
329 r = r_ecal / sin(theta);
334 (
r +
size) * cos(theta));
337 marker->SetScaleCenter(p1.
fX, p1.
fY, p1.
fZ);
338 marker->AddLine(p1, p2);
339 marker->SetLineWidth(4);
341 marker->AddMarker(0, 0.9);
344 marker->SetName(
Form(
"line %s %d",
Collection()->GetCName(), idx));
391 boxset->
SetName(collection->GetCName());
399#define RND_BOX(x) (Float_t) r.Uniform(-(x), (x))
445 for (
auto &i : ids) {
446 auto digi =
fBoxSet->GetDigit(i);
449 if (item->GetVisible()) {
451 fBoxSet->DigitColor(item->GetMainColor());
478 fCaloData->GetSelector()->AddSliceSelector(std::unique_ptr<REveCaloDataSliceSelector>(
512 fCaloData->FillImpliedSelectedSet(impSet, sec_idcs);
559 tableInfo->table(
"TParticle").column(
"pt", 1,
"i.Pt()").column(
"eta", 3,
"i.Eta()").column(
"phi", 3,
"i.Phi()");
561 tableInfo->table(
"Jet")
562 .column(
"eta", 1,
"i.Eta()")
563 .column(
"phi", 1,
"i.Phi()")
564 .column(
"etasize", 2,
"i.GetEtaSize()")
565 .column(
"phisize", 2,
"i.GetPhiSize()");
567 tableInfo->table(
"RecHit").column(
"pt", 1,
"i.fPt");
569 tableInfo->table(
"RCaloTower").column(
"eta", 3,
"i.fEta").column(
"phi", 3,
"i.fPhi").column(
"Et", 3,
"i.fEt");
573 for (
auto &
c :
eveMng->GetScenes()->RefChildren()) {
574 if (
c !=
eveMng->GetGlobalScene() && strncmp(
c->GetCName(),
"Geometry", 8)) {
577 if (!strncmp(
c->GetCName(),
"Table", 5))
586 for (
auto &
l :
fEvent->fListData) {
588 if (collection->
GetName() == std::string(
l->GetName())) {
591 for (
int i = 0; i <=
l->GetLast(); ++i) {
592 std::string cname = collection->
GetName();
593 auto len = cname.size();
594 char end = cname[len - 1];
596 cname = cname.substr(0, len - 1);
619 fEvent->fCaloData->DataChanged();
632 if (strncmp(scene->GetCName(),
"Tables", 5) == 0)
637 if (!strncmp(scene->GetCTitle(),
"Projected", 8)) {
638 g_projMng->ImportElements(product, scene);
640 scene->AddElement(product);
648 tableBuilder->SetHaveAWindow(
true);
649 tableBuilder->SetCollection(collection);
653 tableMng->SetDisplayedCollection(collection->
GetElementId());
657 if (strncmp(s->GetCTitle(),
"Table", 5) == 0) {
658 s->AddElement(tablep);
659 tableBuilder->Build();
662 tableMng->AddDelegate([=]() { tableBuilder->ConfigChanged(); });
668 for (
int t = 0; t <
N; t++) {
669 auto te = tableEntries[t];
688 if (el->GetName() ==
"Tracks")
689 mngTable->SetDisplayedCollection(el->GetElementId());
700 if (proxy->Collection()->GetItemList() == itemList) {
702 proxy->ModelChanges(ids);
713 if (proxy->Collection()->GetItemList() == itemList) {
714 proxy->FillImpliedSelected(impSelSet, sec_idcs);
736 eveMng->GetSelection()->ClearSelection();
737 eveMng->GetHighlight()->ClearSelection();
749 const std::set<int> &secondary_idcs)
override
756 ExecuteNewElementPicked(selection, colItems, multi,
true, colItems->RefSelectedSet());
770 auto event =
new Event();
774 auto deviator = std::make_shared<FWSelectionDeviator>();
775 eveMng->GetSelection()->SetDeviator(deviator);
776 eveMng->GetHighlight()->SetDeviator(deviator);
783 b1->SetMainColor(
kCyan);
784 b1->SetMainTransparency(90);
785 eveMng->GetGlobalScene()->AddElement(b1);
794 auto pgeoScene =
eveMng->SpawnNewScene(
"Geometry projected");
796 g_projMng->ImportElements(b1, pgeoScene);
798 auto tableScene =
eveMng->SpawnNewScene(
"Tables",
"Tables");
799 auto tableView =
eveMng->SpawnNewViewer(
"Table",
"Table View");
800 tableView->AddScene(tableScene);
808 trackCollection->
SetFilterExpr(
"i.Pt() > 4.1 && std::abs(i.Eta()) < 1");
824 auto calo3d =
new REveCalo3D(event->fCaloData);
825 calo3d->SetBarrelRadius(
kR_max);
826 calo3d->SetEndCapPos(
kZ_d);
827 calo3d->SetMaxTowerH(300);
828 eveMng->GetEventScene()->AddElement(calo3d);
843 eventMng->SetName(
"EventManager");
844 eveMng->GetWorld()->AddElement(eventMng);
846 eveMng->GetWorld()->AddCommand(
"NextEvent",
"sap-icon://step", eventMng,
"NextEvent()");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
#define ClassDef(name, id)
static unsigned int total
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
CaloTowerProxyBuilder(REveCaloDataHist *cd)
REveCaloDataHist * fCaloData
void FillImpliedSelected(REveElement::Set_t &impSet, const std::set< int > &sec_idcs, Product *) override
void BuildProduct(const REveDataCollection *collection, REveElement *product, const REveViewContext *) override
void ModelChanges(const REveDataCollection::Ids_t &ids, Product *product) override
void addCollection(REveDataCollection *collection, REveDataProxyBuilderBase *glBuilder, bool showInTable=false)
CollectionManager(Event *event)
REveScene * m_collections
std::vector< REveScene * > m_scenes
void FillImpliedSelected(REveDataItemList *itemList, REveElement::Set_t &impSelSet, const std::set< int > &sec_idcs)
void ModelChanged(REveDataItemList *itemList, const REveDataCollection::Ids_t &ids)
std::vector< REveDataProxyBuilderBase * > m_builders
REveViewContext * m_viewContext
void SetDataItemsFromEvent(REveDataCollection *collection)
CollectionManager * fCMng
EventManager(Event *e, CollectionManager *m)
void MakeParticles(int N)
std::vector< TList * > fListData
REveCaloDataHist * fCaloData
bool DeviateSelection(REveSelection *selection, REveElement *el, bool multi, bool secondary, const std::set< int > &secondary_idcs) override
void LocalModelChanges(int idx, REveElement *el, const REveViewContext *ctx) override
bool HaveSingleProduct() const override
void BuildItemViewType(const Jet &dj, int idx, REveElement *iItemHolder, const std::string &viewType, const REveViewContext *context) override
void SetEtaSize(float iEtaSize)
Jet(Int_t pdg, Int_t status, Int_t mother1, Int_t mother2, Int_t daughter1, Int_t daughter2, Double_t px, Double_t py, Double_t pz, Double_t etot)
void SetPhiSize(float iPhiSize)
RCaloTower(float eta, float phi, float et)
void ProcessSelection(REveCaloData::vCellId_t &sel_cells, UInt_t selectionId, Bool_t multi) override
void GetCellsFromSecondaryIndices(const std::set< int > &idcs, REveCaloData::vCellId_t &out) override
REveCaloTowerSliceSelector(int s, REveDataCollection *c, REveCaloDataHist *h)
REveDataCollection * fCollection
REveCaloDataHist * fCaloData
void AddBox(const Float_t *verts)
REveBoxSet(const REveBoxSet &)=delete
void Reset(EBoxType_e boxType, Bool_t valIsCol, Int_t chunkSize)
REveCaloDataSliceSelector(int s)
virtual void ProcessSelection(REveCaloData::vCellId_t &sel_cells, UInt_t selectionId, bool multi)=0
virtual void GetCellsFromSecondaryIndices(const std::set< int > &idcs, REveCaloData::vCellId_t &out)=0
std::vector< CellId_t > vCellId_t
REveDataItemList * GetItemList()
void SetFilterExpr(const char *filter)
TClass * GetItemClass() const
void * GetDataPtr(Int_t i) const
void AddItem(void *data_ptr, const std::string &n, const std::string &t)
void SetItemClass(TClass *cls)
void SetMainColor(Color_t) override
Set main color of the element.
const REveDataItem * GetDataItem(Int_t i) const
void AddTooltipExpression(const std::string &title, const std::string &expr, bool init=true)
void SetItemsChangeDelegate(ItemsChangeFunc_t)
void SetFillImpliedSelectedDelegate(FillImpliedSelectedFunc_t)
Color_t GetMainColor() const
Bool_t GetVisible() const
void SetHaveAWindow(bool)
virtual void SetCollection(REveDataCollection *)
REveDataProxyBuilderBase()
virtual void LocalModelChanges(int idx, REveElement *el, const REveViewContext *ctx)
virtual REveElement * CreateProduct(const std::string &viewType, const REveViewContext *)
void FillImpliedSelected(REveElement::Set_t &impSet, const std::set< int > &)
void ModelChanges(const REveDataCollection::Ids_t &)
REveDataCollection * Collection() const
void SetupAddElement(REveElement *el, REveElement *parent, bool set_color=true)
REveDataSimpleProxyBuilderTemplate()
void SetMainColor(Color_t color) override
Override from REveElement, forward to Frame.
void DigitColor(Color_t ci)
Set color for the last digit added.
void RefitPlex()
Instruct underlying memory allocator to regroup itself into a contiguous memory chunk.
void DigitValue(Int_t value)
Set signal value for the last digit added.
void SetDetIdsAsSecondaryIndices(Bool_t o)
const std::string & GetName() const
virtual REveElement * GetSelectionMaster()
Returns the master element - that is:
void SetPickable(Bool_t p)
virtual Bool_t GetRnrSelf() const
REveElement * FirstChild() const
Returns the first child element or 0 if the list is empty.
void SetSelectionMaster(REveElement *el)
REveElement * fSelectionMaster
std::set< REveElement * > Set_t
ElementId_t GetElementId() const
REveElement(const std::string &name="", const std::string &title="")
Default constructor.
virtual Color_t GetMainColor() const
void SetName(const std::string &name)
Set name of an element.
REveMagFieldDuo Interface to magnetic field with two different values depending on radius.
static REveManager * Create()
If global REveManager* REX::gEve is not set initialize it.
REveProjectionManager Manager class for steering of projections and managing projected objects.
SelectionSet_t & RefSelectedSet()
void SetAlwaysSecSelect(Bool_t f)
virtual bool DeviateSelection(REveSelection *s, REveElement *el, bool multi, bool secondary, const std::set< int > &secondary_idcs)=0
REveSelection Container for selected and highlighted elements.
void NewElementPicked(ElementId_t id, bool multi, bool secondary, const std::set< int > &secondary_idcs={})
Called from GUI when user picks or un-picks an element.
void SetLineColor(Color_t c)
REveTrackPropagator Calculates path of a particle taking into account special path-marks and imposed ...
REveTrack Track with given vertex, momentum and optional referece-points (path-marks) along its path.
REveTrackPropagator * GetPropagator() const
REveElement * GetSelectionMaster() override
Returns the master element - that is:
void ModelChanges(const REveDataCollection::Ids_t &ids, Product *product) override
void buildBoxSet(REveBoxSet *boxset)
void FillImpliedSelected(REveElement::Set_t &impSet, const std::set< int > &sec_idcs, Product *p) override
void BuildProduct(const REveDataCollection *collection, REveElement *product, const REveViewContext *) override
RecHit(float pt, float x, float y, float z)
void SetName(const char *name)
TDirectory::TContext keeps track and restore the current directory.
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
static Bool_t AddDirectoryStatus()
Check whether TH1-derived classes should register themselves to the current gDirectory.
2-D histogram with a float per channel (see TH1 documentation)
Double_t GetBinContent(Int_t binx, Int_t biny) const override
void Add(TObject *obj) override
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
const char * GetName() const override
Returns name of object.
TObject()
TObject constructor.
void BuildItem(const TParticle &p, int idx, REveElement *iItemHolder, const REveViewContext *context) override
Description of the dynamic properties of a particle.
TParticle()
default constructor
Double_t Theta(const TParticle &p)
This is the base class for the ROOT Random number generators.
virtual Int_t GetLast() const
Returns index of last object in collection.
const char * Data() const
ROOT::Experimental::REveProjectionManager * g_projMng
ROOT::Experimental::REveManager * eveMng
void collection_proxies(bool proj=true)
REX::REveManager * eveMng
REX::REveViewer * rhoZView
REX::REveScene * rhoZEventScene
Namespace for ROOT features in testing.
REveVectorT< Float_t > REveVector
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
constexpr Double_t TwoPi()
const double xbins[xbins_n]