Coder Social home page Coder Social logo

Comments (4)

hapol avatar hapol commented on June 22, 2024

Hi Anna,
it is not possible to instantiate twice the same detector in two locations. To my understanding there is a single kDetector identifier and energy losses in any of the two objects will fill the same data structure. You should use a different detector (another fiber set)... or modify the code heavily (data structure should be modified to add a detector instance; ProcessHit() should be able to assign the detector instance based on the GEANT volume name, ...). I would recommend to use another similar detector; I do not see other easy solution.
Hope it helps. Cheers

from r3broot.

acorsi avatar acorsi commented on June 22, 2024

Hi Hector, I see. The question arises for fibers, and it seems to me that all fibers/fi* classes are very similar (right?) so maybe this is the easy solution, use different ones for different instances. Thanks! Anna

from r3broot.

jose-luis-rs avatar jose-luis-rs commented on June 22, 2024

I have implemented a general class to make simulations with the fibers, named R3BFiber, below you can find how to invoke it for fiber-30:

if (fFi30){
if (fi30Par) {
fi30Par->printParams();
auto rfib30 = new TGeoRotation("Fi30rot");
rfib30->RotateX(fi30Par->GetRotX());
rfib30->RotateY(fi30Par->GetRotY());
rfib30->RotateZ(fi30Par->GetRotZ());
run->AddModule(new R3BFiber("Fi30", fFi30Geo, DetectorId::kFI30, {fi30Par->GetPosX(), fi30Par->GetPosY(),
fi30Par->GetPosZ(), rfib30}));
} else {
run->AddModule(new R3BFiber("Fi30", fFi30Geo, DetectorId::kFI30, {0., 0., 890.}));
}
}
The parameters used for positioning the fiber (positions and angles) are read from a .par file that should contain the same positions and angles used for the analysis of real data. This allows us to overlap simulations with experiments in a simple way.

An example of macro for the simulation is here:
https://github.com/R3BRootGroup/R3BParams_S522/blob/dev/macros/sim/runsim.C

from r3broot.

jose-luis-rs avatar jose-luis-rs commented on June 22, 2024

In the folder R3BParams_S522/macros/rootgeo (the same for other parameter repositories) you can find all the macros to create the root geometry of each detector. There is also a script named "setgeo.sh" that generates everything automatically doing (don't forget to load your config.sh file before executing this script):
. setgeo.sh

from r3broot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.