Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • EIC/detectors/athena
  • zwzhao/athena
  • FernandoTA/athena
  • palspeic/athena
4 results
Show changes
Showing
with 826 additions and 148 deletions
//----------------------------------
// pfRICH: Proximity Focusing RICH
// Author: C. Dilks
//----------------------------------
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/OpticalSurfaces.h"
#include "DD4hep/Printout.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "GeometryHelpers.h"
#include "Math/Point2D.h"
#include "TMath.h"
#include "TString.h"
#include <XML/Helper.h>
using namespace dd4hep;
using namespace dd4hep::rec;
// create the detector
static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens)
{
xml::DetElement detElem = handle;
std::string detName = detElem.nameStr();
int detID = detElem.id();
DetElement det(detName, detID);
xml::Component dims = detElem.dimensions();
OpticalSurfaceManager surfMgr = desc.surfaceManager();
// attributes -----------------------------------------------------------
// - vessel
double vesselLength = dims.attr<double>(_Unicode(length));
double vesselZmin = dims.attr<double>(_Unicode(zmin));
double vesselZmax = dims.attr<double>(_Unicode(zmax));
double vesselRmin0 = dims.attr<double>(_Unicode(rmin0));
double vesselRmin1 = dims.attr<double>(_Unicode(rmin1));
double vesselRmax0 = dims.attr<double>(_Unicode(rmax0));
double vesselRmax1 = dims.attr<double>(_Unicode(rmax1));
double wallThickness = dims.attr<double>(_Unicode(wall_thickness));
double windowThickness = dims.attr<double>(_Unicode(window_thickness));
auto vesselMat = desc.material(detElem.attr<std::string>(_Unicode(material)));
auto gasvolMat = desc.material(detElem.attr<std::string>(_Unicode(gas)));
auto vesselVis = desc.visAttributes(detElem.attr<std::string>(_Unicode(vis_vessel)));
auto gasvolVis = desc.visAttributes(detElem.attr<std::string>(_Unicode(vis_gas)));
// - radiator (applies to aerogel and filter)
auto radiatorElem = detElem.child(_Unicode(radiator));
double radiatorRmin = radiatorElem.attr<double>(_Unicode(rmin));
double radiatorRmax = radiatorElem.attr<double>(_Unicode(rmax));
double radiatorPhiw = radiatorElem.attr<double>(_Unicode(phiw));
double radiatorPitch = radiatorElem.attr<double>(_Unicode(pitch));
double radiatorFrontplane = radiatorElem.attr<double>(_Unicode(frontplane));
// - aerogel
auto aerogelElem = radiatorElem.child(_Unicode(aerogel));
auto aerogelMat = desc.material(aerogelElem.attr<std::string>(_Unicode(material)));
auto aerogelVis = desc.visAttributes(aerogelElem.attr<std::string>(_Unicode(vis)));
double aerogelThickness = aerogelElem.attr<double>(_Unicode(thickness));
// - filter
auto filterElem = radiatorElem.child(_Unicode(filter));
auto filterMat = desc.material(filterElem.attr<std::string>(_Unicode(material)));
auto filterVis = desc.visAttributes(filterElem.attr<std::string>(_Unicode(vis)));
double filterThickness = filterElem.attr<double>(_Unicode(thickness));
// - sensor module
auto sensorElem = detElem.child(_Unicode(sensors)).child(_Unicode(module));
auto sensorMat = desc.material(sensorElem.attr<std::string>(_Unicode(material)));
auto sensorVis = desc.visAttributes(sensorElem.attr<std::string>(_Unicode(vis)));
auto sensorSurf = surfMgr.opticalSurface(sensorElem.attr<std::string>(_Unicode(surface)));
double sensorSide = sensorElem.attr<double>(_Unicode(side));
double sensorGap = sensorElem.attr<double>(_Unicode(gap));
double sensorThickness = sensorElem.attr<double>(_Unicode(thickness));
// - sensor plane
auto sensorPlaneElem = detElem.child(_Unicode(sensors)).child(_Unicode(plane));
double sensorPlaneDist = sensorPlaneElem.attr<double>(_Unicode(sensordist));
double sensorPlaneRmin = sensorPlaneElem.attr<double>(_Unicode(rmin));
double sensorPlaneRmax = sensorPlaneElem.attr<double>(_Unicode(rmax));
// - debugging switches
int debug_optics_mode = detElem.attr<int>(_Unicode(debug_optics));
// if debugging optics, override some settings
bool debug_optics = debug_optics_mode > 0;
if (debug_optics) {
printout(WARNING, "PFRICH_geo", "DEBUGGING PFRICH OPTICS");
switch (debug_optics_mode) {
case 1:
vesselMat = aerogelMat = filterMat = sensorMat = gasvolMat = desc.material("VacuumOptical");
break;
case 2:
vesselMat = aerogelMat = filterMat = sensorMat = desc.material("VacuumOptical");
break;
default:
printout(FATAL, "PFRICH_geo", "UNKNOWN debug_optics_mode");
return det;
};
aerogelVis = sensorVis;
gasvolVis = vesselVis = desc.invisible();
};
// BUILD VESSEL //////////////////////////////////////
/* - `vessel`: aluminum enclosure, the mother volume of the pfRICH
* - `gasvol`: gas volume, which fills `vessel`; all other volumes defined below
* are children of `gasvol`
*/
// tank solids
double boreDelta = vesselRmin1 - vesselRmin0;
Cone vesselTank(vesselLength / 2.0, vesselRmin1, vesselRmax1, vesselRmin0, vesselRmax0);
Cone gasvolTank(vesselLength / 2.0 - windowThickness, vesselRmin1 + wallThickness, vesselRmax1 - wallThickness,
vesselRmin0 + wallThickness, vesselRmax0 - wallThickness);
// extra solids for `debug_optics` only
Box vesselBox(1001, 1001, 1001);
Box gasvolBox(1000, 1000, 1000);
// choose vessel and gasvol solids (depending on `debug_optics_mode` (0=disabled))
Solid vesselSolid, gasvolSolid;
switch (debug_optics_mode) {
case 0:
vesselSolid = vesselTank;
gasvolSolid = gasvolTank;
break; // `!debug_optics`
case 1:
vesselSolid = vesselBox;
gasvolSolid = gasvolBox;
break;
case 2:
vesselSolid = vesselBox;
gasvolSolid = gasvolTank;
break;
};
// volumes
Volume vesselVol(detName, vesselSolid, vesselMat);
Volume gasvolVol(detName + "_gas", gasvolSolid, gasvolMat);
vesselVol.setVisAttributes(vesselVis);
gasvolVol.setVisAttributes(gasvolVis);
// reference positions
// - the vessel is created such that the center of the cylindrical tank volume
// coincides with the origin; this is called the "origin position" of the vessel
// - when the vessel (and its children volumes) is placed, it is translated in
// the z-direction to be in the proper ATHENA-integration location
// - these reference positions are for the frontplane and backplane of the vessel,
// with respect to the vessel origin position
auto originFront = Position(0., 0., vesselLength / 2.0);
auto originBack = Position(0., 0., -vesselLength / 2.0);
// sensitive detector type
sens.setType("tracker");
// BUILD RADIATOR //////////////////////////////////////
// attributes
double airGap = 0.01*mm; // air gap between aerogel and filter (FIXME? actually it's currently a gas gap)
// solid and volume: create aerogel and filter
Cone aerogelSolid(
aerogelThickness/2,
radiatorRmin + boreDelta * aerogelThickness / vesselLength, /* at backplane */
radiatorRmax,
radiatorRmin, /* at frontplane */
radiatorRmax
);
Cone filterSolid(
filterThickness/2,
radiatorRmin + boreDelta * (aerogelThickness + airGap + filterThickness) / vesselLength, /* at backplane */
radiatorRmax,
radiatorRmin + boreDelta * (aerogelThickness + airGap) / vesselLength, /* at frontplane */
radiatorRmax
);
Volume aerogelVol(detName + "_aerogel", aerogelSolid, aerogelMat);
Volume filterVol(detName + "_filter", filterSolid, filterMat);
aerogelVol.setVisAttributes(aerogelVis);
filterVol.setVisAttributes(filterVis);
// aerogel placement and surface properties
// TODO [low-priority]: define skin properties for aerogel and filter
auto radiatorPos = Position(0., 0., radiatorFrontplane - 0.5 * aerogelThickness) + originFront;
auto aerogelPV = gasvolVol.placeVolume(
aerogelVol,
Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront
* RotationY(radiatorPitch) // change polar angle to specified pitch // (FIXME: probably broken, currently not in use)
);
DetElement aerogelDE(det, "aerogel_de", 0);
aerogelDE.setPlacement(aerogelPV);
// SkinSurface aerogelSkin(desc, aerogelDE, "mirror_optical_surface", aerogelSurf, aerogelVol);
// aerogelSkin.isValid();
// filter placement and surface properties
if (!debug_optics) {
auto filterPV = gasvolVol.placeVolume(
filterVol,
Translation3D(0., 0., -airGap) // add an airgap (FIXME: actually a gas gap)
* Translation3D(radiatorPos.x(), radiatorPos.y(), radiatorPos.z()) // re-center to originFront
* RotationY(radiatorPitch) // change polar angle
* Translation3D(0., 0., -(aerogelThickness + filterThickness) / 2.) // move to aerogel backplane
);
DetElement filterDE(det, "filter_de", 0);
filterDE.setPlacement(filterPV);
// SkinSurface filterSkin(desc, filterDE, "mirror_optical_surface", filterSurf, filterVol);
// filterSkin.isValid();
};
// BUILD SENSORS ///////////////////////
// solid and volume: single sensor module
Box sensorSolid(sensorSide / 2., sensorSide / 2., sensorThickness / 2.);
Volume sensorVol(detName + "_sensor", sensorSolid, sensorMat);
sensorVol.setVisAttributes(sensorVis);
// sensitivity
if (!debug_optics)
sensorVol.setSensitiveDetector(sens);
// sensor plane positioning: we want `sensorPlaneDist` to be the distance between the
// aerogel backplane (i.e., aerogel/filter boundary) and the sensor active surface (e.g, photocathode)
double sensorZpos = radiatorFrontplane - aerogelThickness - sensorPlaneDist - 0.5 * sensorThickness;
auto sensorPlanePos = Position(0., 0., sensorZpos) + originFront; // reference position
// miscellaneous
int imod = 0; // module number
double tBoxMax = vesselRmax1; // sensors will be tiled in tBox, within annular limits
// SENSOR MODULE LOOP ------------------------
/* cartesian tiling loop
* - start at (x=0,y=0), to center the grid
* - loop over positive-x positions; for each, place the corresponding negative-x sensor too
* - nested similar loop over y positions
*/
double sx, sy;
for (double usx = 0; usx <= tBoxMax; usx += sensorSide + sensorGap) {
for (int sgnx = 1; sgnx >= (usx > 0 ? -1 : 1); sgnx -= 2) {
for (double usy = 0; usy <= tBoxMax; usy += sensorSide + sensorGap) {
for (int sgny = 1; sgny >= (usy > 0 ? -1 : 1); sgny -= 2) {
// sensor (x,y) center
sx = sgnx * usx;
sy = sgny * usy;
// annular cut
if (std::hypot(sx, sy) < sensorPlaneRmin || std::hypot(sx, sy) > sensorPlaneRmax)
continue;
// placement (note: transformations are in reverse order)
auto sensorPV = gasvolVol.placeVolume(
sensorVol, Transform3D(Translation3D(sensorPlanePos.x(), sensorPlanePos.y(),
sensorPlanePos.z()) // move to reference position
* Translation3D(sx, sy, 0.) // move to grid position
));
// generate LUT for module number -> sensor position, for readout mapping tests
// printf("%d %f %f\n",imod,sensorPV.position().x(),sensorPV.position().y());
// properties
sensorPV.addPhysVolID("module", imod);
DetElement sensorDE(det, Form("sensor_de_%d", imod), imod);
sensorDE.setPlacement(sensorPV);
if (!debug_optics) {
SkinSurface sensorSkin(desc, sensorDE, "sensor_optical_surface", sensorSurf,
sensorVol); // TODO: 3rd arg needs `imod`?
sensorSkin.isValid();
};
// increment sensor module number
imod++;
};
};
};
};
// END SENSOR MODULE LOOP ------------------------
//
// Add service material if desired
if (detElem.child("sensors").hasChild("services")) {
xml_comp_t x_service = detElem.child("sensors").child(_Unicode(services));
Assembly service_vol("services");
service_vol.setVisAttributes(desc, x_service.visStr());
// Compute service total thickness from components
double total_thickness = 0;
xml_coll_t ci(x_service, _Unicode(component));
for (ci.reset(), total_thickness = 0.0; ci; ++ci) {
total_thickness += xml_comp_t(ci).thickness();
}
int ncomponents = 0;
double thickness_sum = -total_thickness / 2.0;
for (xml_coll_t ci(x_service, _Unicode(component)); ci; ++ci, ncomponents++) {
xml_comp_t x_comp = ci;
double thickness = x_comp.thickness();
Tube c_tube{sensorPlaneRmin, sensorPlaneRmax, thickness/2};
Volume c_vol{_toString(ncomponents, "component%d"), c_tube, desc.material(x_comp.materialStr())};
c_vol.setVisAttributes(desc, x_comp.visStr());
service_vol.placeVolume(c_vol, Position(0, 0, thickness_sum + thickness / 2.0));
thickness_sum += thickness;
}
gasvolVol.placeVolume(service_vol,
Transform3D(Translation3D(sensorPlanePos.x(), sensorPlanePos.y(),
sensorPlanePos.z() - sensorThickness - total_thickness)));
}
// place gas volume
PlacedVolume gasvolPV = vesselVol.placeVolume(gasvolVol, Position(0, 0, 0));
DetElement gasvolDE(det, "gasvol_de", 0);
gasvolDE.setPlacement(gasvolPV);
// place mother volume (vessel)
Volume motherVol = desc.pickMotherVolume(det);
PlacedVolume vesselPV = motherVol.placeVolume(vesselVol, Position(0, 0, vesselZmin) - originFront);
vesselPV.addPhysVolID("system", detID);
det.setPlacement(vesselPV);
return det;
};
// clang-format off
DECLARE_DETELEMENT(athena_PFRICH, createDetector)
......@@ -11,7 +11,7 @@
//
//==========================================================================
//
// Modified for TOPSiDE detector
// Modified for ATHENA detector
//
//==========================================================================
#include "DD4hep/DetFactoryHelper.h"
......@@ -32,7 +32,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
int numsides = dim.numsides();
xml::Component pos = x_det.position();
double rmin = dim.rmin();
double rmax = dim.rmax() * std::cos(M_PI / numsides);
double rmax = dim.rmax();
double zmin = dim.zmin();
Layering layering(x_det);
double totalThickness = layering.totalThickness();
......@@ -129,3 +129,4 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
// clang-format off
DECLARE_DETELEMENT(athena_PolyhedraEndcapCalorimeter2, create_detector)
DECLARE_DETELEMENT(athena_PolyhedraEndcapCalorimeter, create_detector)
//==========================================================================
// Scintillating fiber calorimeter with tower shape blocks
// reference: https://github.com/adamjaro/lmon/blob/master/calo/src/WScFiZXv3.cxx
// Support disk placement
//--------------------------------------------------------------------------
// Author: Chao Peng (ANL)
// Date: 07/19/2021
//==========================================================================
#include "GeometryHelpers.h"
#include "DD4hep/DetFactoryHelper.h"
#include <XML/Helper.h>
#include <iostream>
#include <algorithm>
#include <tuple>
#include <math.h>
using namespace dd4hep;
using Point = ROOT::Math::XYPoint;
std::tuple<Volume, Position> build_module(const Detector &desc, const xml::Component &mod_x, SensitiveDetector &sens);
// helper function to get x, y, z if defined in a xml component
template<class XmlComp>
Position get_xml_xyz(const XmlComp &comp, dd4hep::xml::Strng_t name)
{
Position pos(0., 0., 0.);
if (comp.hasChild(name)) {
auto child = comp.child(name);
pos.SetX(dd4hep::getAttrOrDefault<double>(child, _Unicode(x), 0.));
pos.SetY(dd4hep::getAttrOrDefault<double>(child, _Unicode(y), 0.));
pos.SetZ(dd4hep::getAttrOrDefault<double>(child, _Unicode(z), 0.));
}
return pos;
}
// main
static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens)
{
xml::DetElement detElem = handle;
std::string detName = detElem.nameStr();
int detID = detElem.id();
DetElement det(detName, detID);
sens.setType("calorimeter");
auto dim = detElem.dimensions();
auto rmin = dim.rmin();
auto rmax = dim.rmax();
auto length = dim.length();
auto phimin = dd4hep::getAttrOrDefault<double>(dim, _Unicode(phimin), 0.);
auto phimax = dd4hep::getAttrOrDefault<double>(dim, _Unicode(phimax), 2.*M_PI);
// envelope
Tube envShape(rmin, rmax, length/2., phimin, phimax);
Volume env(detName + "_envelope", envShape, desc.material("Air"));
env.setVisAttributes(desc.visAttributes(detElem.visStr()));
// build module
auto [modVol, modSize] = build_module(desc, detElem.child(_Unicode(module)), sens);
double modSizeR = std::sqrt(modSize.x() * modSize.x() + modSize.y() * modSize.y());
double assembly_rwidth = modSizeR*2.;
int nas = int((rmax - rmin) / assembly_rwidth) + 1;
std::vector<Assembly> assemblies;
// calorimeter block z-offsets (as blocks are shorter than the volume length)
const double block_offset = -0.5*(length - modSize.z());
for (int i = 0; i < nas; ++i) {
Assembly assembly(detName + Form("_ring%d", i + 1));
auto assemblyPV = env.placeVolume(assembly, Position{0., 0., block_offset});
assemblyPV.addPhysVolID("ring", i + 1);
assemblies.emplace_back(std::move(assembly));
}
// std::cout << assemblies.size() << std::endl;
int modid = 1;
for (int ix = 0; ix < int(2.*rmax / modSize.x()) + 1; ++ix) {
double mx = modSize.x() * ix - rmax;
for (int iy = 0; iy < int(2.*rmax / modSize.y()) + 1; ++iy) {
double my = modSize.y() * iy - rmax;
double mr = std::sqrt(mx*mx + my*my);
if (mr - modSizeR >= rmin && mr + modSizeR <= rmax) {
int ias = int((mr - rmin) / assembly_rwidth);
auto &assembly = assemblies[ias];
auto modPV = assembly.placeVolume(modVol, Position(mx, my, 0.));
modPV.addPhysVolID("module", modid++);
}
}
}
desc.add(Constant(detName + "_NModules", std::to_string(modid - 1)));
for (auto &assembly : assemblies) {
assembly.ptr()->Voxelize("");
}
// detector position and rotation
auto pos = get_xml_xyz(detElem, _Unicode(position));
auto rot = get_xml_xyz(detElem, _Unicode(rotation));
Volume motherVol = desc.pickMotherVolume(det);
Transform3D tr = Translation3D(pos.x(), pos.y(), pos.z()) * RotationZYX(rot.z(), rot.y(), rot.x());
PlacedVolume envPV = motherVol.placeVolume(env, tr);
envPV.addPhysVolID("system", detID);
det.setPlacement(envPV);
return det;
}
// helper function to build module with scintillating fibers
std::tuple<Volume, Position> build_module(const Detector &desc, const xml::Component &mod_x, SensitiveDetector &sens)
{
auto sx = mod_x.attr<double>(_Unicode(sizex));
auto sy = mod_x.attr<double>(_Unicode(sizey));
auto sz = mod_x.attr<double>(_Unicode(sizez));
Box modShape(sx/2., sy/2., sz/2.);
auto modMat = desc.material(mod_x.attr<std::string>(_Unicode(material)));
Volume modVol("module_vol", modShape, modMat);
if (mod_x.hasAttr(_Unicode(vis))) {
modVol.setVisAttributes(desc.visAttributes(mod_x.attr<std::string>(_Unicode(vis))));
}
if (mod_x.hasChild("fiber")) {
auto fiber_x = mod_x.child(_Unicode(fiber));
auto fr = fiber_x.attr<double>(_Unicode(radius));
auto fsx = fiber_x.attr<double>(_Unicode(spacex));
auto fsy = fiber_x.attr<double>(_Unicode(spacey));
auto foff = dd4hep::getAttrOrDefault<double>(fiber_x, _Unicode(offset), 0.5*mm);
auto fiberMat = desc.material(fiber_x.attr<std::string>(_Unicode(material)));
Tube fiberShape(0., fr, sz/2.);
Volume fiberVol("fiber_vol", fiberShape, fiberMat);
fiberVol.setSensitiveDetector(sens);
// Fibers are placed in a honeycomb with the radius = sqrt(3)/2. * hexagon side length
// So each fiber is fully contained in a regular hexagon, which are placed as
// ______________________________________
// | ____ ____ |
// even: | / \ / \ |
// | ____/ \____/ \____ |
// | / \ / \ / \ |
// odd: | / \____/ \____/ \ |
// | \ / \ / \ / |
// | \____/ \____/ \____/ |
// even: | \ / \ / |
// | \____/ \____/ ___|___
// |____________________________________|___offset
// | |
// |offset
// the parameters space x and space y are used to add additional spaces between the hexagons
double fside = 2. / std::sqrt(3.) * fr;
double fdistx = 2. * fside + fsx;
double fdisty = 2. * fr + fsy;
// maximum numbers of the fibers, help narrow the loop range
int nx = int(sx / (2.*fr)) + 1;
int ny = int(sy / (2.*fr)) + 1;
// std::cout << sx << ", " << sy << ", " << fr << ", " << nx << ", " << ny << std::endl;
// place the fibers
double y0 = (foff + fside);
int nfibers = 0;
for (int iy = 0; iy < ny; ++iy) {
double y = y0 + fdisty * iy;
// about to touch the boundary
if ((sy - y) < y0) { break; }
double x0 = (iy % 2) ? (foff + fside) : (foff + fside + fdistx / 2.);
for (int ix = 0; ix < nx; ++ix) {
double x = x0 + fdistx * ix;
// about to touch the boundary
if ((sx - x) < x0) { break; }
auto fiberPV = modVol.placeVolume(fiberVol, nfibers++, Position{x - sx/2., y - sy/2., 0});
//std::cout << "(" << ix << ", " << iy << ", " << x - sx/2. << ", " << y - sy/2. << ", " << fr << "),\n";
fiberPV.addPhysVolID("fiber_x", ix + 1).addPhysVolID("fiber_y", iy + 1);
}
}
// if no fibers we make the module itself sensitive
} else {
modVol.setSensitiveDetector(sens);
}
return std::make_tuple(modVol, Position{sx, sy, sz});
}
DECLARE_DETELEMENT(ScFiCalorimeter, create_detector)
......@@ -15,14 +15,20 @@
//
//==========================================================================
#include "DD4hep/DetFactoryHelper.h"
#if defined(USE_ACTSDD4HEP)
#include "ActsDD4hep/ActsExtension.hpp"
#include "ActsDD4hep/ConvertMaterial.hpp"
#else
#include "Acts/Plugins/DD4hep/ActsExtension.hpp"
#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp"
#endif
using namespace std;
using namespace dd4hep;
using namespace dd4hep::detail;
static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens)
static Ref_t SimpleDiskDetector_create_detector(Detector& description, xml_h e, SensitiveDetector sens)
{
xml_det_t x_det = e;
Material air = description.air();
......@@ -126,6 +132,5 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
return sdet;
}
DECLARE_DETELEMENT(athena_SimpleDiskTracker, create_detector)
DECLARE_DETELEMENT(ref_DiskTracker, create_detector)
DECLARE_DETELEMENT(ref_SolenoidEndcap, create_detector)
DECLARE_DETELEMENT(ref_SolenoidEndcap, SimpleDiskDetector_create_detector)
DECLARE_DETELEMENT(athena_SolenoidEndcap, SimpleDiskDetector_create_detector)
//==========================================================================
// AIDA Detector description implementation
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
// Modified : W.Armstrong
//
//==========================================================================
//
// Specialized generic detector constructor
//
//==========================================================================
#include "DD4hep/DetFactoryHelper.h"
using namespace std;
using namespace dd4hep;
using namespace dd4hep::detail;
static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector sens) {
xml_det_t x_det = e;
Material air = description.air();
string det_name = x_det.nameStr();
bool reflect = x_det.reflect();
DetElement sdet(det_name,x_det.id());
Assembly assembly(det_name);
PlacedVolume pv;
int l_num = 0;
xml::Component pos = x_det.position();
for(xml_coll_t i(x_det,_U(layer)); i; ++i, ++l_num) {
xml_comp_t x_layer = i;
string l_nam = det_name + _toString(l_num, "_layer%d");
double x_lay = x_layer.x();
double y_lay = x_layer.y();
double z = 0;
double zmin = 0;
double layerWidth = 0.;
int s_num = 0;
for(xml_coll_t j(x_layer,_U(slice)); j; ++j) {
double thickness = xml_comp_t(j).thickness();
layerWidth += thickness;
}
Box l_box(x_lay/2.0, y_lay/2.0, layerWidth/2.0 );
Volume l_vol(l_nam, l_box, air);
l_vol.setVisAttributes(description, x_layer.visStr());
for (xml_coll_t j(x_layer, _U(slice)); j; ++j, ++s_num) {
xml_comp_t x_slice = j;
double thick = x_slice.thickness();
Material mat = description.material(x_slice.materialStr());
string s_nam = l_nam + _toString(s_num, "_slice%d");
Volume s_vol(s_nam, Box(x_lay/2.0, y_lay/2.0, thick/2.0), mat);
if (x_slice.isSensitive()) {
sens.setType("tracker");
s_vol.setSensitiveDetector(sens);
}
s_vol.setAttributes(description, x_slice.regionStr(), x_slice.limitsStr(), x_slice.visStr());
pv = l_vol.placeVolume(s_vol, Position(0, 0, z - zmin - layerWidth / 2 + thick / 2));
pv.addPhysVolID("slice", s_num);
}
DetElement layer(sdet,l_nam+"_pos",l_num);
pv = assembly.placeVolume(l_vol,Position(0,0,zmin+layerWidth/2.));
pv.addPhysVolID("layer",l_num);
pv.addPhysVolID("barrel",1);
layer.setPlacement(pv);
if ( reflect ) {
pv = assembly.placeVolume(l_vol,Transform3D(RotationY(M_PI),Position(0,0,-zmin-layerWidth/2)));
pv.addPhysVolID("layer",l_num);
pv.addPhysVolID("barrel",2);
DetElement layerR = layer.clone(l_nam+"_neg");
sdet.add(layerR.setPlacement(pv));
}
}
if ( x_det.hasAttr(_U(combineHits)) ) {
sdet.setCombineHits(x_det.attr<bool>(_U(combineHits)),sens);
}
pv = description.pickMotherVolume(sdet).placeVolume(assembly,Position(pos.x(),pos.y(),pos.z()));
pv.addPhysVolID("system", x_det.id()); // Set the subdetector system ID.
sdet.setPlacement(pv);
return sdet;
}
DECLARE_DETELEMENT(ref_RectangularTracker,create_detector)
/** \addtogroup Trackers Trackers
* \brief Type: **BarrelTrackerWithFrame**.
* \author W. Armstrong
*
* \ingroup trackers
*
* @{
*/
#include <array>
#include <map>
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/Surface.h"
#include "DDRec/DetectorData.h"
#include "XML/Utilities.h"
#include "XML/Layering.h"
#if defined(USE_ACTSDD4HEP)
#include "ActsDD4hep/ActsExtension.hpp"
#include "ActsDD4hep/ConvertMaterial.hpp"
#else
#include "Acts/Plugins/DD4hep/ActsExtension.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/Plugins/DD4hep/ConvertDD4hepMaterial.hpp"
#endif
using namespace std;
using namespace dd4hep;
using namespace dd4hep::rec;
using namespace dd4hep::detail;
/*! Endcap Trapezoidal Tracker.
/** Endcap Trapezoidal Tracker.
*
* @author Whitney Armstrong
*
......@@ -23,19 +45,32 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
DetElement sdet(det_name, det_id);
Assembly assembly(det_name);
Material air = description.material("Air");
// Volume assembly (det_name,Box(10000,10000,10000),vacuum);
Volume motherVol = description.pickMotherVolume(sdet);
int m_id = 0, c_id = 0, n_sensor = 0;
map<string, Volume> modules;
map<string, Placements> sensitives;
map<string, std::vector<VolPlane>> volplane_surfaces;
map<string, std::array<double, 2>> module_thicknesses;
PlacedVolume pv;
Acts::ActsExtension* detWorldExt = new Acts::ActsExtension();
detWorldExt->addType("endcap", "detector");
sdet.addExtension<Acts::ActsExtension>(detWorldExt);
// ACTS extension
{
Acts::ActsExtension* detWorldExt = new Acts::ActsExtension();
detWorldExt->addType("endcap", "detector");
// SJJ probably need to set the envelope here, as ACTS can't figure
// that out for Assembly volumes. May also need binning to properly pick up
// on the support material @TODO
//
// Add the volume boundary material if configured
for (xml_coll_t bmat(x_det, _Unicode(boundary_material)); bmat; ++bmat) {
xml_comp_t x_boundary_material = bmat;
Acts::xmlToProtoSurfaceMaterial(x_boundary_material, *detWorldExt, "boundary_material");
}
sdet.addExtension<Acts::ActsExtension>(detWorldExt);
}
assembly.setVisAttributes(description.invisible());
sens.setType("tracker");
......@@ -46,16 +81,36 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
double support_length = getAttrOrDefault(x_support, _U(length), 2.0 * mm);
double support_rmin = getAttrOrDefault(x_support, _U(rmin), 2.0 * mm);
double support_zstart = getAttrOrDefault(x_support, _U(zstart), 2.0 * mm);
std::string support_name = getAttrOrDefault<std::string>(x_support, _Unicode(name), "support_tube");
std::string support_vis = getAttrOrDefault<std::string>(x_support, _Unicode(vis), "AnlRed");
Material support_mat = description.material(x_support.materialStr());
Tube support_tub(support_rmin, support_rmin + support_thickness, support_length / 2);
Volume support_vol("support_tube", support_tub, support_mat); // Create the layer envelope volume.
support_vol.setVisAttributes(description.visAttributes(support_vis));
if(reflect) {
pv = assembly.placeVolume(support_vol, Position(0, 0, -1.0 * (support_zstart + support_length / 2)));
xml_dim_t pos (x_support.child(_U(position), false));
xml_dim_t rot (x_support.child(_U(rotation), false));
Solid support_solid;
if(x_support.hasChild("shape")){
xml_comp_t shape(x_support.child(_U(shape)));
string shape_type = shape.typeStr();
support_solid = xml::createShape(description, shape_type, shape);
} else {
pv = assembly.placeVolume(support_vol, Position(0, 0, support_zstart + support_length / 2));
support_solid = Tube(support_rmin, support_rmin + support_thickness, support_length / 2);
}
Transform3D tr = Transform3D(Rotation3D(),Position(0,0,(reflect?-1.0:1.0) * (support_zstart + support_length / 2)));
if ( pos.ptr() && rot.ptr() ) {
Rotation3D rot3D(RotationZYX(rot.z(0),rot.y(0),rot.x(0)));
Position pos3D(pos.x(0),pos.y(0),pos.z(0));
tr = Transform3D(rot3D, pos3D);
}
else if ( pos.ptr() ) {
tr = Transform3D(Rotation3D(),Position(pos.x(0),pos.y(0),pos.z(0)));
}
else if ( rot.ptr() ) {
Rotation3D rot3D(RotationZYX(rot.z(0),rot.y(0),rot.x(0)));
tr = Transform3D(rot3D,Position());
}
Material support_mat = description.material(x_support.materialStr());
Volume support_vol(support_name, support_solid, support_mat);
support_vol.setVisAttributes(description.visAttributes(support_vis));
pv = assembly.placeVolume(support_vol, tr);
// pv = assembly.placeVolume(support_vol, Position(0, 0, support_zstart + support_length / 2));
}
for (xml_coll_t mi(x_det, _U(module)); mi; ++mi, ++m_id) {
......@@ -67,12 +122,15 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
double x1 = trd.x1();
double x2 = trd.x2();
double z = trd.z();
double y1, y2, total_thickness = 0.;
double total_thickness = 0.;
xml_coll_t ci(x_mod, _U(module_component));
for (ci.reset(), total_thickness = 0.0; ci; ++ci)
total_thickness += xml_comp_t(ci).thickness();
y1 = y2 = total_thickness / 2;
double thickness_so_far = 0.0;
double thickness_sum = -total_thickness / 2.0;
double y1 = total_thickness / 2;
double y2 = total_thickness / 2;
Trapezoid m_solid(x1, x2, y1, y2, z);
Volume m_volume(m_nam, m_solid, vacuum);
m_volume.setVisAttributes(description.visAttributes(x_mod.visStr()));
......@@ -121,6 +179,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
c_vol.setVisAttributes(description.visAttributes(c.visStr()));
pv = m_volume.placeVolume(c_vol, Position(0, posY + c_thick / 2, 0));
if (c.isSensitive()) {
module_thicknesses[m_nam] = {thickness_so_far + c_thick/2.0, total_thickness-thickness_so_far - c_thick/2.0};
//std::cout << " adding sensitive volume" << c_name << "\n";
sdet.check(n_sensor > 2, "SiTrackerEndcap2::fromCompact: " + c_name + " Max of 2 modules allowed!");
pv.addPhysVolID("sensor", n_sensor);
......@@ -128,8 +187,30 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
c_vol.setSensitiveDetector(sens);
sensitives[m_nam].push_back(pv);
++n_sensor;
// -------- create a measurement plane for the tracking surface attched to the sensitive volume -----
Vector3D u(0., 0., -1.);
Vector3D v(-1., 0., 0.);
Vector3D n(0., 1., 0.);
// Vector3D o( 0. , 0. , 0. ) ;
// compute the inner and outer thicknesses that need to be assigned to the tracking surface
// depending on wether the support is above or below the sensor
double inner_thickness = module_thicknesses[m_nam][0];
double outer_thickness = module_thicknesses[m_nam][1];
SurfaceType type(SurfaceType::Sensitive);
// if( isStripDetector )
// type.setProperty( SurfaceType::Measurement1D , true ) ;
VolPlane surf(c_vol, type, inner_thickness, outer_thickness, u, v, n); //,o ) ;
volplane_surfaces[m_nam].push_back(surf);
//--------------------------------------------
}
posY += c_thick;
thickness_sum += c_thick;
thickness_so_far += c_thick;
}
modules[m_nam] = m_volume;
}
......@@ -161,20 +242,25 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
if (reflect) {
layer_pv =
assembly.placeVolume(layer_vol, Transform3D(RotationZYX(0.0, -M_PI, 0.0), Position(0, 0, -layer_center_z)));
layer_pv.addPhysVolID("barrel", 3).addPhysVolID("layer", l_id);
layer_pv.addPhysVolID("layer", l_id);
layer_name += "_N";
} else {
layer_pv = assembly.placeVolume(layer_vol, Position(0, 0, layer_center_z));
layer_pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id);
layer_pv.addPhysVolID("layer", l_id);
layer_name += "_P";
}
DetElement layer_element(sdet, layer_name, l_id);
layer_element.setPlacement(layer_pv);
Acts::ActsExtension* layerExtension = new Acts::ActsExtension();
layerExtension->addType("layer", "layer");
layerExtension->addType("sensitive disk", "layer");
//layerExtension->addType("axes", "definitions", "XZY");
//layerExtension->addType("sensitive disk", "layer");
//layerExtension->addType("axes", "definitions", "XZY");
for (xml_coll_t lmat(x_layer, _Unicode(layer_material)); lmat; ++lmat) {
xml_comp_t x_layer_material = lmat;
xmlToProtoSurfaceMaterial(x_layer_material, *layerExtension, "layer_material");
}
layer_element.addExtension<Acts::ActsExtension>(layerExtension);
for (xml_coll_t ri(x_layer, _U(ring)); ri; ++ri) {
......@@ -199,7 +285,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
DetElement module(layer_element, m_base + "_pos", det_id);
pv = layer_vol.placeVolume(
m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, zstart + dz)));
pv.addPhysVolID("barrel", 1).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num);
pv.addPhysVolID("module", mod_num);
module.setPlacement(pv);
for (size_t ic = 0; ic < sensVols.size(); ++ic) {
PlacedVolume sens_pv = sensVols[ic];
......@@ -208,11 +294,12 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
//std::cout << " adding ACTS extension" << "\n";
Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("XZY");
comp_elt.addExtension<Acts::ActsExtension>(moduleExtension);
volSurfaceList(comp_elt)->push_back(volplane_surfaces[m_nam][ic]);
}
} else {
pv = layer_vol.placeVolume(
m_vol, Transform3D(RotationZYX(0, -M_PI / 2 - phi, -M_PI / 2), Position(x, y, -zstart - dz)));
pv.addPhysVolID("barrel", 2).addPhysVolID("layer", l_id).addPhysVolID("module", mod_num);
pv.addPhysVolID("module", mod_num);
DetElement r_module(layer_element, m_base + "_neg", det_id);
r_module.setPlacement(pv);
for (size_t ic = 0; ic < sensVols.size(); ++ic) {
......@@ -222,6 +309,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
//std::cout << " adding ACTS extension" << "\n";
Acts::ActsExtension* moduleExtension = new Acts::ActsExtension("XZY");
comp_elt.addExtension<Acts::ActsExtension>(moduleExtension);
volSurfaceList(comp_elt)->push_back(volplane_surfaces[m_nam][ic]);
}
}
dz = -dz;
......@@ -236,6 +324,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
return sdet;
}
//@}
// clang-format off
DECLARE_DETELEMENT(athena_TrapEndcapTracker, create_detector)
DECLARE_DETELEMENT(athena_GEMTrackerEndcap, create_detector)
view_prim:detector_only:
extends: .views
stage: test
script:
- ./bin/generate_prim_file -o ${LOCAL_DATA_PATH} -D -t detector_view
- ls -lrth && ls -lrth ${LOCAL_DATA_PATH}
view_prim:ev001:
extends: .views
stage: test
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/generate_prim_file -o ${LOCAL_DATA_PATH} -t view_ev001 -s 1
view_prim:ev002:
extends: .views
stage: test
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/generate_prim_file -o ${LOCAL_DATA_PATH} -t view_ev002 -s 2
view_prim:ev003:
extends: .views
stage: test
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/generate_prim_file -o ${LOCAL_DATA_PATH} -t view_ev003 -s 3
view_prim:ev004:
extends: .views
stage: test
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/generate_prim_file -o ${LOCAL_DATA_PATH} -t view_ev004 -s 4
view_prim:calorimeters:
extends: .views
stage: test
script:
- cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/."
- ./bin/generate_prim_file -c ${DETECTOR_PATH}/calorimeters.xml -o ${LOCAL_DATA_PATH} -D -t calorimeters_view
- ls -lrth && ls -lrth ${LOCAL_DATA_PATH}
view_prim:calorimeters_ev001:
extends: .views
stage: test
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/."
- ./bin/generate_prim_file -c ${DETECTOR_PATH}/calorimeters.xml -o ${LOCAL_DATA_PATH} -t calorimeters_view_ev001 -s 1
view_prim:calorimeters_ev002:
extends: .views
stage: test
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/."
- ./bin/generate_prim_file -c ${DETECTOR_PATH}/calorimeters.xml -o ${LOCAL_DATA_PATH} -t calorimeters_view_ev002 -s 2
dawn_view_01:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view01 -d scripts/view1 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view01 -d scripts/view1 -D
dawn_view_01:ev001:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
needs:
- job: view_prim:ev001
optional: true
script:
- ./bin/make_dawn_views -t view01_ev001 -d scripts/view1 -s 1
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view01_ev001 -d scripts/view1 -s 1
dawn_view_01:ev002:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
needs:
- job: view_prim:ev002
optional: true
script:
- ./bin/make_dawn_views -t view01_ev002 -d scripts/view1 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view01_ev002 -d scripts/view1 -s 2
view_01:
stage: collect
rules:
- if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"'
needs:
- job: dawn_view_01:detector
optional: false
......
dawn_view_11:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view11 -d scripts/view11 -D
dawn_view_11:ev000:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
needs:
- job: view_prim:ev001
optional: true
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view11 -d scripts/view11
dawn_view_11:ev001:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
needs:
- job: view_prim:ev001
optional: true
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 1
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view11 -d scripts/view11 -s 1
dawn_view_11:ev002:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
needs:
- job: view_prim:ev002
optional: true
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev003.prim -t view11 -d scripts/view11 -s 2
dawn_view_11:ev003:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
needs:
- job: view_prim:ev003
optional: true
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 3
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH} -t view11 -d scripts/view11 -s 3
dawn_view_11:ev004:
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
extends: .views
needs:
- job: view_prim:ev004
optional: true
script:
- ./bin/make_dawn_views -t view11 -d scripts/view11 -s 4
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH} -t view11 -d scripts/view11 -s 4
view_11:
stage: collect
......
dawn_view_12:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view12 -d scripts/view12 -D -- ${SLICE}
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view12 -d scripts/view12 -D -- ${SLICE}
- ls -lrth *
- ls -lrth images/*
parallel:
......
dawn_view_13:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view13 -d scripts/view13 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view13 -d scripts/view13 -D
view_13:
stage: collect
......
dawn_view_14:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view14 -d scripts/view14 -D -- ${SLICE}
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view14 -d scripts/view14 -D -- ${SLICE}
- ls -lrth *
- ls -lrth images/*
parallel:
......
dawn_view_15:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view15 -d scripts/view15 -D -- ${SLICE}
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view15 -d scripts/view15 -D -- ${SLICE}
- ls -lrth *
- ls -lrth images/*
parallel:
......
dawn_view_02:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view02 -d scripts/view2 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view02 -d scripts/view2 -D
dawn_view_02:ev001:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
needs:
- job: view_prim:ev001
optional: true
script:
- ./bin/make_dawn_views -t view02_ev001 -d scripts/view2 -s 1
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view02_ev001 -d scripts/view2 -s 1
dawn_view_02:ev002:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
needs:
- job: view_prim:ev002
optional: true
script:
- ./bin/make_dawn_views -t view02_ev002 -d scripts/view2 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view02_ev002 -d scripts/view2 -s 2
dawn_view_02:ev003:
extends: .views
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
needs:
- job: view_prim:ev003
optional: true
script:
- ./bin/make_dawn_views -t view02_ev003 -d scripts/view2 -s 3
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev003.prim -t view02_ev003 -d scripts/view2 -s 3
view_02:
stage: collect
......@@ -32,7 +47,6 @@ view_02:
optional: true
- job: dawn_view_02:ev003
optional: true
#- ["dawn_view_02:detector", "dawn_view_02:ev001", "dawn_view_02:ev002", "dawn_view_02:ev003"]
script:
- ls -lrth *
- ls -lrth images/*
......
dawn_view_20:detector:
extends: .views
needs:
- job: view_prim:calorimeters
optional: false
script:
- cp "compact/subsystem_views/calorimeters.xml" "${DETECTOR_PATH}/."
- ./bin/make_dawn_views -c ${DETECTOR_PATH}/calorimeters.xml -t calorimeters_view20 -d scripts/view20 -D
- ./bin/make_dawn_views -c ${DETECTOR_PATH}/calorimeters.xml -i ${LOCAL_DATA_PATH}/calorimeters_view.prim -t view20 -d scripts/view20 -D
dawn_view_20:ev001:
extends: .views
needs:
- job: view_prim:calorimeters_ev001
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view20_ev001 -d scripts/view20 -s 1
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/calorimeters_view_ev001.prim -t view20_ev001 -d scripts/view20 -s 1
dawn_view_20:ev002:
extends: .views
needs:
- job: view_prim:calorimeters_ev002
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view20_ev002 -d scripts/view20 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/calorimeters_view_ev002.prim -t view20_ev002 -d scripts/view20 -s 2
view_20:
stage: collect
......
dawn_view_03:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view02 -d scripts/view3 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view03 -d scripts/view3 -D
#dawn_view_03:ev001:
# extends: .views
# needs:
# - job: view_prim:ev001
# optional: true
# script:
# - ./bin/make_dawn_views -t view02_ev001 -d scripts/view3 -s 1
# - ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view03_ev001 -d scripts/view3 -s 1
dawn_view_03:ev002:
extends: .views
needs:
- job: view_prim:ev002
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view02_ev002 -d scripts/view3 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view03_ev002 -d scripts/view3 -s 2
view_03:
stage: collect
......
dawn_view_06:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view06 -d scripts/view6 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view06 -d scripts/view6 -D
dawn_view_06:ev001:
extends: .views
needs:
- job: view_prim:ev001
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view06_ev001 -d scripts/view6 -s 1
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view06_ev001 -d scripts/view6 -s 1
dawn_view_06:ev002:
extends: .views
needs:
- job: view_prim:ev002
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view06_ev002 -d scripts/view6 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view06_ev002 -d scripts/view6 -s 2
dawn_view_06:ev003:
extends: .views
needs:
- job: view_prim:ev003
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view06_ev003 -d scripts/view6 -s 3
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev003.prim -t view06_ev003 -d scripts/view6 -s 3
dawn_view_06:ev004:
extends: .views
needs:
- job: view_prim:ev004
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view06_ev004 -d scripts/view6 -s 4
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH} -t view06_ev004 -d scripts/view6 -s 4
view_06:
stage: collect
......
dawn_view_07:detector:
extends: .views
needs:
- job: view_prim:detector_only
optional: false
script:
- ./bin/make_dawn_views -t view07 -d scripts/view7 -D
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/detector_view.prim -t view07 -d scripts/view7 -D
dawn_view_07:ev002:
extends: .views
needs:
- job: view_prim:ev002
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view07_ev002 -d scripts/view7 -s 2
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev001.prim -t view07_ev002 -d scripts/view7 -s 2
dawn_view_07:ev003:
extends: .views
needs:
- job: view_prim:ev003
optional: true
rules:
- if: '$DETECTOR_EVENT_VIEWS == "ON"'
script:
- ./bin/make_dawn_views -t view07_ev003 -d scripts/view7 -s 3
- ./bin/make_dawn_views -i ${LOCAL_DATA_PATH}/view_ev002.prim -t view07_ev003 -d scripts/view7 -s 3
view_07:
stage: collect
......