diff --git a/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc b/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc index 8b4738d312..6e7d8d542b 100644 --- a/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc +++ b/DAQ/src/CrvDigisFromArtdaqFragmentsFEBII_module.cc @@ -33,9 +33,11 @@ namespace mu2e public: struct Config { - fhicl::Atom diagLevel{fhicl::Name("diagLevel"), fhicl::Comment("diagnostic Level")}; - fhicl::Atom produceZS{fhicl::Name("produceZS"), fhicl::Comment("produce ZS digi collection"), true}; - fhicl::Atom produceNZS{fhicl::Name("produceNZS"), fhicl::Comment("produce NZS digi collection"), false}; + fhicl::Atom diagLevel{fhicl::Name("diagLevel"), fhicl::Comment("diagnostic Level")}; + fhicl::Atom firstCrvDtcID{fhicl::Name("firstCrvDtcID"), fhicl::Comment("First CRV DTC ID"), 0}; + fhicl::Atom produceZS{fhicl::Name("produceZS"), fhicl::Comment("produce ZS digi collection"), true}; + fhicl::Atom produceNZS{fhicl::Name("produceNZS"), fhicl::Comment("produce NZS digi collection"), false}; + fhicl::Atom useROC4asROC2{fhicl::Name("useROC4asROC2"), fhicl::Comment("use ROC4 as ROC2"), false}; }; explicit CrvDigisFromArtdaqFragmentsFEBII(const art::EDProducer::Table& config); @@ -44,16 +46,20 @@ namespace mu2e private: int _diagLevel; + uint8_t _firstCrvDtcID; bool _produceZS; bool _produceNZS; + bool _useROC4asROC2; mu2e::ProditionsHandle _channelMap_h; }; CrvDigisFromArtdaqFragmentsFEBII::CrvDigisFromArtdaqFragmentsFEBII(const art::EDProducer::Table& config) : art::EDProducer{config}, _diagLevel(config().diagLevel()), + _firstCrvDtcID(config().firstCrvDtcID()), _produceZS(config().produceZS()), - _produceNZS(config().produceNZS()) + _produceNZS(config().produceNZS()), + _useROC4asROC2(config().useROC4asROC2()) { if(_produceZS) produces(); if(_produceNZS) produces("NZS"); @@ -212,7 +218,8 @@ namespace mu2e { uint16_t dtcID = header->GetID(); uint16_t linkID = header->GetLinkID(); - uint16_t rocID = dtcID*CRVId::nROCPerDTC + linkID + 1; //ROC IDs are between 1 and 18 + uint16_t rocID = (dtcID-_firstCrvDtcID)*CRVId::nROCPerDTC + linkID + 1; //ROC IDs are between 1 and 18 + if(_useROC4asROC2 && rocID==4) rocID=2; uint16_t rocPort = crvHit.getPortNumber(); //Port numbers beween 1 and 24 uint16_t febChannel = (crvHit.getFpgaNumber()<<4) + (crvHit.getFpgaChannel() & 0xF); //use only 4 lowest bits of the fpgaChannel //the 5th bit indicates special situations @@ -284,7 +291,8 @@ namespace mu2e uint16_t dtcID = header->GetID(); uint16_t linkID = header->GetLinkID(); - uint16_t rocID = dtcID*CRVId::nROCPerDTC + linkID + 1; //ROC IDs are between 1 and 18 + uint16_t rocID = (dtcID-_firstCrvDtcID)*CRVId::nROCPerDTC + linkID + 1; //ROC IDs are between 1 and 18 + if(_useROC4asROC2 && rocID==4) rocID=2; if((crvHit.getFpgaChannel() & 0x10) == 0) //special situation, if the 5th bit of the fpgaChannel is non-zero (see below) { diff --git a/Mu2eG4/geom/crv_counters_extracted_v03.txt b/Mu2eG4/geom/crv_counters_extracted_v03.txt new file mode 100644 index 0000000000..8379b3c1e7 --- /dev/null +++ b/Mu2eG4/geom/crv_counters_extracted_v03.txt @@ -0,0 +1,128 @@ +//CRV module geometry in the extracted detector geometry. + +//Comment (1): The nominal gap between two dicounters is 0.366mm according to crv_parameters.xlsx on doc-db. +// The smaller value of 0.2mm was found empirically by tests at Wideband. + +string crs.name = "extracted"; // to coordinate with conditions + +int crs.nSectors = 3; +int crs.nLayers = 4; + +vector crs.sectorNames = {"EX", //0 + "T1", //1 trigger module 1 + "T2"}; //2 trigger module 2 + +double crs.scintillatorBarLengthEX = 6000; //0 CRV-T modules +double crs.scintillatorBarLengthT1 = 2370; //1 CRV-D short modules +double crs.scintillatorBarLengthT2 = 3200; //2 CRV-L endcap modules + +double crs.scintillatorBarThickness = 19.8; //mm +double crs.scintillatorBarWidth = 51.3; //mm +double crs.layerOffset = 42; //mm +double crs.gapLarge = 0.2; //mm //see comment (1) above +double crs.gapSmall = 0.0; //mm +double crs.gapBetweenModules = 4.433; //mm +vector crs.gapBetweenLayers = {9.525, 9.525, 9.525}; //mm +double crs.aluminumSheetThickness = 3.175; //mm +double crs.strongBackThickness = 12.7; //mm + +int crs.nModulesEX = 4; //0 +int crs.nModulesT1 = 2; //1 +int crs.nModulesT2 = 2; //2 + +int crs.nCountersPerModuleEX = 16; //0 //per layer +int crs.nCountersPerModuleT1 = 16; //1 +int crs.nCountersPerModuleT2 = 16; //2 + +vector crs.firstCounterEX = {-3904.00, 4387, 21439.55}; //0 //in mu2e coordinates +vector crs.firstCounterT1 = {-4702.77, 4237, 23064.95}; //1 +vector crs.firstCounterT2 = {-3904.00, 4537, 22266.18}; //2 + +string crs.scintillatorBarMaterialName = "G4_POLYSTYRENE"; +string crs.absorberMaterialName = "G4_Al"; +string crs.aluminumSheetMaterialName = "G4_Al"; + +bool crs.veto.visible = true; +bool crs.veto.solid = true; +int crs.verbosityLevel = 0; + +vector crs.layerDirectionEX = {0, 1, 0}; //0 +vector crs.layerDirectionT1 = {0, 1, 0}; //1 +vector crs.layerDirectionT2 = {0, 1, 0}; //2 + +vector crs.offsetDirectionEX = {0, 0, -1}; //0 +vector crs.offsetDirectionT1 = {0, 0, 0}; //1 no offset +vector crs.offsetDirectionT2 = {0, 0, -1}; //2 + +vector crs.gapDirectionEX = {0, 0, 1}; //0 +vector crs.gapDirectionT1 = {1, 0, 0}; //1 +vector crs.gapDirectionT2 = {0, 0, 1}; //2 + +// virtual detectors +bool vd.crv.build = false; + +// counter mother boards +double crs.CMBOffset = 15.0; +double crs.CMBHalfThickness = 5.0; +string crs.CMBMaterialName = "ElectronicsCMB"; + +// information about the SiPMs +double crs.fiberSeparation = 26.0; //mm + +// Using CRV-DS modules as bottom trigger modules. They have readouts at one side only. +// side 0 is the negative side of the counter, i.e. the -x side of a CRV-T counter, or the -y side of a CRV-R counter +bool crs.sipmsAtSide0EX = true; //0 +bool crs.sipmsAtSide0T1 = false; //1 +bool crs.sipmsAtSide0T2 = true; //2 + +// side 1 is the positive side of the counter, i.e. the +x side of a CRV-T counter, or the +y side of a CRV-R counter +bool crs.sipmsAtSide1EX = true; //0 +bool crs.sipmsAtSide1T1 = true; //1 +bool crs.sipmsAtSide1T2 = true; //2 + +// information about the coincidence groups +int crs.precedingSectorForEX = -1; //0 //no preceding sector +int crs.precedingSectorForT1 = -1; //1 //no preceding sector +int crs.precedingSectorForT2 = -1; //2 //no preceding sector + +int crs.sectorTypeEX = 1; //0 +int crs.sectorTypeT1 = 2; //1 +int crs.sectorTypeT2 = 3; //2 + +//information about the FEBs +int crs.FEBBoxesAtSide0EX = 0; //0 +int crs.FEBBoxesAtSide0T1 = 0; //1 +int crs.FEBBoxesAtSide0T2 = 0; //2 + +int crs.FEBBoxesAtSide1EX = 0; //0 +int crs.FEBBoxesAtSide1T1 = 0; //1 +int crs.FEBBoxesAtSide1T2 = 0; //2 + +string crs.FEBMaterialName = "ElectronicsFEB"; +double crs.FEBDistanceToModule = 50; //between surface of 4th scintillator layer and center of 1st FEB +double crs.FEBDistanceToEdge = 240.0; +double crs.FEBDistanceBetween2FEBsW = 397.9; //between two FEBs sitting next to each other +double crs.FEBDistanceBetween2FEBsT = 47.7; //between two FEBs sitting on top of each other +vector crs.FEBHalfLengths = {5.0, 150.0, 92.5}; //thickness, width, lengths w.r.t. counter orientation + +//simplified version of the top support structure +//total area in Offline: 110.38m^2 +//total volume in CAD model: 0.8092m^3 +//--> thickness in Offline: 7.336mm +int crs.nSupportStructures = 0; //TODO: this is only a place holder so far +vector crs.supportStructureNames = {}; +// vector crs.supportStructurePosition_CRV_Support_T = {-3904.0, 2570.0, 10617.2}; +// vector crs.supportStructureHalfLengths_CRV_Support_T = {2463.8, 2.5, 7924.8}; +// string crs.supportStructureMaterialName = "G4_Fe"; + + +//MARS requires gdml file with unique logical volumes for the CMBs +bool crs.forMARS = false; + +//FIXME: this is temporary until the GDML issue is fixed +bool crs.hideCRVCMBs = true; + +// This tells emacs to view this file in c++ mode. +// Local Variables: +// mode:c++ +// End: diff --git a/Mu2eG4/geom/geom_common_extracted.txt b/Mu2eG4/geom/geom_common_extracted.txt index af19a346aa..d81fcc1ee9 100644 --- a/Mu2eG4/geom/geom_common_extracted.txt +++ b/Mu2eG4/geom/geom_common_extracted.txt @@ -1,2 +1,2 @@ //Extracted position for the detector KPP -#include "Offline/Mu2eG4/geom/geom_common_extracted_v02.txt" +#include "Offline/Mu2eG4/geom/geom_common_extracted_v03.txt" diff --git a/Mu2eG4/geom/geom_common_extracted_v03.txt b/Mu2eG4/geom/geom_common_extracted_v03.txt new file mode 100644 index 0000000000..16c6f2d19d --- /dev/null +++ b/Mu2eG4/geom/geom_common_extracted_v03.txt @@ -0,0 +1,80 @@ +// Top level geometry file for extracted detector cosmics running with no magnetic field + +// Start from recent baseline geometry +#include "Offline/Mu2eG4/geom/geom_common.txt" + +// Special - for garage position! +bool inGaragePosition = true; +double garage.zOffset = 14000.0; // for creating special garageFakeDS(2/3)Vacuum volume +bool garage.extractOPA_IPA_ST = false; //include the OPA, IPA, and Stopping Target in the extracted train + +// End special + +//bool hasCosmicRayShield = false; // It would be nice to be able to turn +// CRV off like this, but that breaks things downstream - LOOK INTO THIS! +// Turn off CRV below for now. +bool hasSTM = false; + +// Offset the detector system +double mu2e.detectorSystemZ0 = 24171.; // mm + +//Reduce shielding block above DS, only cover some of extracted detectors +vector building.dsArea.hatchblock.xPositions = { + 24551.8, // B + 29123.8, // C + 29123.8, // C1 + 24551.8 // E +}; + +double building.dsArea.hatchblock.yHalfThickness = 228.6; +double building.dsArea.hatchblock.offsetFromFloorSurface.y = 6172.2; + +vector building.dsArea.hatchblock.yPositions = { + -1193.8, // B + -1193.8, // C + -8509.0, // C1 + -8509.0 // A +}; + +// G-block on the west is rotated 90 degrees +vector building.dsArea.hatchblock.E.xPositions = { +24093.8, // 0 +24093.8, // 1 +24551.8, // 2 +24551.8 // 3 +}; + +double building.dsArea.hatchblock.E.yHalfThickness = 457.2; +double building.dsArea.hatchblock.E.offsetFromFloorSurface.y = 6400.8; + +// Turn off downstream external shields +int ExtShieldDownstream.numberOfBoxTypes = 0; +double ExtShieldDownstream.detecHoleZ = 32007.0; + +// Put MBS in garage position +double mbs.MBSCZ = 29273.0; + +// Put Tracker in garage +double tracker.mother.z0 = 24175.0; // Garage position only +double tracker.z0 = 24171.0; // Garage position only + + +// Put Crystal calorimeter in garage +double calorimeter.caloMotherZ0 = 25842; +double calorimeter.caloMotherZ1 = 27220; +double calorimeter.calorimeterZFront = 25843.0; + +//CRV in the extracted position for the detector KPP +#include "Offline/Mu2eG4/geom/crv_counters_extracted_v03.txt" + +// +// End notes: +// +// 1) Sources of information: +// +// +// +// This tells emacs to view this file in c++ mode. +// Local Variables: +// mode:c++ +// End: