File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed
Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,14 @@ struct PadCoordinates {
7171// / create a vector of pad corner coordinate for one full sector
7272std::vector<PadCoordinates> getPadCoordinatesSector ();
7373
74+ // / binning vector with radial pad-row positions (in cm)
75+ // / \param roc roc number (0-35 IROC, 36-71 OROC, >=72 full sector)
76+ std::vector<double > getRowBinningCM (uint32_t roc = 72 );
77+
7478// / ROC title from ROC number
7579std::string getROCTitle (const int rocNumber);
7680
77- // using T=float;
81+ // using T=float;
7882// / Drawing of a CalDet object
7983// / \param CalDet object to draw
8084// / \return TCanvas containing CalDet content
Original file line number Diff line number Diff line change @@ -79,6 +79,45 @@ std::vector<painter::PadCoordinates> painter::getPadCoordinatesSector()
7979 return padCoords;
8080}
8181
82+ std::vector<double > painter::getRowBinningCM (uint32_t roc)
83+ {
84+ const Mapper& mapper = Mapper::instance ();
85+
86+ int firstRegion = 0 , lastRegion = 10 ;
87+ if (roc < 36 ) {
88+ firstRegion = 0 ;
89+ lastRegion = 4 ;
90+ } else if (roc < 72 ) {
91+ firstRegion = 4 ;
92+ lastRegion = 10 ;
93+ }
94+
95+ std::vector<double > binning;
96+
97+ float lastPadHeight = mapper.getPadRegionInfo (firstRegion).getPadHeight ();
98+ float localX = mapper.getPadRegionInfo (firstRegion).getRadiusFirstRow ();
99+ binning.emplace_back (localX - 3 );
100+ binning.emplace_back (localX);
101+ for (int iregion = firstRegion; iregion < lastRegion; ++iregion) {
102+ const auto & regionInfo = mapper.getPadRegionInfo (iregion);
103+ const auto padHeight = regionInfo.getPadHeight ();
104+
105+ if (std::abs (padHeight - lastPadHeight) > 1e-5 ) {
106+ lastPadHeight = padHeight;
107+ localX = regionInfo.getRadiusFirstRow ();
108+ binning.emplace_back (localX);
109+ }
110+
111+ for (int irow = 0 ; irow < regionInfo.getNumberOfPadRows (); ++irow) {
112+ localX += lastPadHeight;
113+ binning.emplace_back (localX);
114+ }
115+ }
116+ binning.emplace_back (localX + 3 );
117+
118+ return binning;
119+ }
120+
82121std::string painter::getROCTitle (const int rocNumber)
83122{
84123 const std::string_view type = (rocNumber < 36 ) ? " IROC" : " OROC" ;
You can’t perform that action at this time.
0 commit comments