| | 1 | {{{ |
| | 2 | SELECT |
| | 3 | Events.* |
| | 4 | FROM RunInfo |
| | 5 | LEFT JOIN Events USING (FileId) |
| | 6 | LEFT JOIN Position USING (FileId, EvtNumber) |
| | 7 | WHERE |
| | 8 | fSourceKey=5 |
| | 9 | AND |
| | 10 | fRunTypeKey=1 |
| | 11 | AND |
| | 12 | FileId BETWEEN 131101000 AND 131107000 |
| | 13 | AND |
| | 14 | fZenithDistanceMax<35 |
| | 15 | AND |
| | 16 | fR750Ref/fR750Cor>0.9 |
| | 17 | }}} |
| | 18 | |
| | 19 | Without writing a file and without filling the root trees internally |
| | 20 | |
| | 21 | {{{ |
| | 22 | ------------------------ Rootify SQL ------------------------- |
| | 23 | Reading query from file './crab-data-only.sql'. |
| | 24 | Connecting to database... |
| | 25 | Client Version: 5.7.23 |
| | 26 | Server Version: 5.7.23-0ubuntu0.18.04.1 |
| | 27 | Compression of databse connection is OFF |
| | 28 | Connection to databases is ENCRYPTED (DHE-RSA-AES256-SHA) |
| | 29 | Requesting data... |
| | 30 | Opening file '/dev/null' [compression=1]... |
| | 31 | Writing data to tree 'Result' |
| | 32 | Trying to setup 44 branches... |
| | 33 | Configured 44 branches. |
| | 34 | Filling branches... |
| | 35 | 2305973 rows fetched. |
| | 36 | 1 rows skipped due to NULL field. |
| | 37 | 0 rows filled into tree. |
| | 38 | 0 B written to disk. |
| | 39 | File closed. |
| | 40 | Execution time: 40.3481s (17.5 us/row) |
| | 41 | -------------------------------------------------------------- |
| | 42 | |
| | 43 | |
| | 44 | Status Duration CPU User CPU System |
| | 45 | -------------------------------------------------------------- |
| | 46 | [...] |
| | 47 | Sending data 39.854647 29.566965 0.343076 |
| | 48 | [...] |
| | 49 | -------------------------------------------------------------- |
| | 50 | |
| | 51 | Bytes_sent 750 |
| | 52 | Bytes_received 833 M |
| | 53 | }}} |
| | 54 | |
| | 55 | Same query with writing a file |
| | 56 | |
| | 57 | {{{ |
| | 58 | ------------------------ Rootify SQL ------------------------- |
| | 59 | Reading query from file './crab-data-only.sql'. |
| | 60 | Connecting to database... |
| | 61 | Client Version: 5.7.23 |
| | 62 | Server Version: 5.7.23-0ubuntu0.18.04.1 |
| | 63 | Compression of databse connection is OFF |
| | 64 | Connection to databases is ENCRYPTED (DHE-RSA-AES256-SHA) |
| | 65 | Requesting data... |
| | 66 | Opening file 'crab.root' [compression=1]... |
| | 67 | Writing data to tree 'Result' |
| | 68 | Trying to setup 44 branches... |
| | 69 | Configured 44 branches. |
| | 70 | Filling branches... |
| | 71 | 2305973 rows fetched. |
| | 72 | 1 rows skipped due to NULL field. |
| | 73 | 2305972 rows filled into tree. |
| | 74 | 355 MB written to disk. |
| | 75 | File closed. |
| | 76 | Execution time: 59.3526s (25.7 us/row) |
| | 77 | -------------------------------------------------------------- |
| | 78 | |
| | 79 | |
| | 80 | Status Duration CPU User CPU System |
| | 81 | -------------------------------------------------------------- |
| | 82 | [...] |
| | 83 | Sending data 58.076298 29.343025 0.337940 |
| | 84 | [...] |
| | 85 | -------------------------------------------------------------- |
| | 86 | |
| | 87 | Bytes_sent 750 |
| | 88 | Bytes_received 833 M |
| | 89 | }}} |
| | 90 | |
| | 91 | Query calculating the source dependent parameters for the on source position only |
| | 92 | |
| | 93 | {{{ |
| | 94 | SELECT |
| | 95 | Events.*, |
| | 96 | @DX := MeanX-X/1.02, |
| | 97 | @DY := MeanY-Y/1.02, |
| | 98 | @Norm := SQRT(@DX*@DX + @DY*@DY), |
| | 99 | @Dist := @Norm*0.0117193246260285378 AS Dist, |
| | 100 | PI()*Width*Length*0.0117193246260285378*0.0117193246260285378 AS Area, |
| | 101 | @LX := TRUNCATE((CosDelta*@DY - SinDelta*@DX)/@Norm, 6), |
| | 102 | @LY := TRUNCATE((CosDelta*@DX + SinDelta*@DY)/@Norm, 6), |
| | 103 | @Alpha := ASIN(@LX) AS Alpha, |
| | 104 | @Sign := SIGN(@LY) AS Sign, |
| | 105 | @M3L := M3Long*@Sign*0.0117193246260285378, |
| | 106 | @Slope := SlopeLong*@Sign/0.0117193246260285378 AS Slope, |
| | 107 | @Xi := 1.39 + 0.154*@Slope + 1.679*(1-1/(1+4.86*Leakage1)), |
| | 108 | @Sign1 := @M3L+0.07, |
| | 109 | @Sign2 := (@Dist-0.5)*7.2-@Slope, |
| | 110 | @Disp := IF (SIGN(@Sign1)<0 || SIGN(@Sign2)<0, -@Xi, @Xi) * (1-Width/Length), |
| | 111 | @ThetaSq := (@Disp*@Disp + @Dist*@Dist - 2*@Disp*@Dist*SQRT(1-@LX*@LX)) AS ThetaSq |
| | 112 | FROM RunInfo |
| | 113 | LEFT JOIN Events USING (FileId) |
| | 114 | LEFT JOIN Position USING (FileId, EvtNumber) |
| | 115 | WHERE |
| | 116 | fSourceKey=5 |
| | 117 | AND |
| | 118 | fRunTypeKey=1 |
| | 119 | AND |
| | 120 | FileId BETWEEN 131101000 AND 131107000 |
| | 121 | AND |
| | 122 | fZenithDistanceMax<35 |
| | 123 | AND |
| | 124 | fR750Ref/fR750Cor>0.9 |
| | 125 | }}} |
| | 126 | |
| | 127 | Without writing to a file and without filling the root trees |
| | 128 | |
| | 129 | {{{ |
| | 130 | ------------------------ Rootify SQL ------------------------- |
| | 131 | Reading query from file './crab-0deg.sql'. |
| | 132 | Connecting to database... |
| | 133 | Client Version: 5.7.23 |
| | 134 | Server Version: 5.7.23-0ubuntu0.18.04.1 |
| | 135 | Compression of databse connection is OFF |
| | 136 | Connection to databases is ENCRYPTED (DHE-RSA-AES256-SHA) |
| | 137 | Requesting data... |
| | 138 | Opening file '/dev/null' [compression=1]... |
| | 139 | Writing data to tree 'Result' |
| | 140 | Trying to setup 60 branches... |
| | 141 | 10 branches skipped due to name starting with @. |
| | 142 | Configured 50 branches. |
| | 143 | Filling branches... |
| | 144 | 2305973 rows fetched. |
| | 145 | 1 rows skipped due to NULL field. |
| | 146 | 0 rows filled into tree. |
| | 147 | 0 B written to disk. |
| | 148 | File closed. |
| | 149 | Execution time: 74.8984s (32.5 us/row) |
| | 150 | -------------------------------------------------------------- |
| | 151 | |
| | 152 | |
| | 153 | Status Duration CPU User CPU System |
| | 154 | -------------------------------------------------------------- |
| | 155 | starting 0.000125 0.000119 0.000004 |
| | 156 | checking permissions 0.000004 0.000003 0.000001 |
| | 157 | checking permissions 0.000002 0.000002 0.000000 |
| | 158 | checking permissions 0.000003 0.000002 0.000000 |
| | 159 | Opening tables 0.000018 0.000018 0.000000 |
| | 160 | init 0.000226 0.000000 0.000226 |
| | 161 | System lock 0.000008 0.000000 0.000008 |
| | 162 | optimizing 0.000016 0.000000 0.000016 |
| | 163 | statistics 0.000067 0.000000 0.000067 |
| | 164 | preparing 0.000016 0.000000 0.000016 |
| | 165 | executing 0.000003 0.000000 0.000002 |
| | 166 | Sending data 74.844972 74.051538 0.809659 |
| | 167 | end 0.000011 0.000010 0.000001 |
| | 168 | query end 0.000009 0.000009 0.000000 |
| | 169 | closing tables 0.000007 0.000006 0.000000 |
| | 170 | freeing items 0.000048 0.000047 0.000002 |
| | 171 | cleaning up 0.000014 0.000013 0.000000 |
| | 172 | -------------------------------------------------------------- |
| | 173 | |
| | 174 | Bytes_sent 1.6 k |
| | 175 | Bytes_received 1.5 G |
| | 176 | }}} |
| | 177 | |
| | 178 | And with writing to a file |
| | 179 | |
| | 180 | {{{ |
| | 181 | ------------------------ Rootify SQL ------------------------- |
| | 182 | Reading query from file './crab-0deg.sql'. |
| | 183 | Connecting to database... |
| | 184 | Client Version: 5.7.23 |
| | 185 | Server Version: 5.7.23-0ubuntu0.18.04.1 |
| | 186 | Compression of databse connection is OFF |
| | 187 | Connection to databases is ENCRYPTED (DHE-RSA-AES256-SHA) |
| | 188 | Requesting data... |
| | 189 | Opening file 'crab.root' [compression=1]... |
| | 190 | Writing data to tree 'Result' |
| | 191 | Trying to setup 60 branches... |
| | 192 | 10 branches skipped due to name starting with @. |
| | 193 | Configured 50 branches. |
| | 194 | Filling branches... |
| | 195 | 2305973 rows fetched. |
| | 196 | 1 rows skipped due to NULL field. |
| | 197 | 2305972 rows filled into tree. |
| | 198 | 444 MB written to disk. |
| | 199 | File closed. |
| | 200 | Execution time: 84.1606s (36.5 us/row) |
| | 201 | -------------------------------------------------------------- |
| | 202 | |
| | 203 | |
| | 204 | Status Duration CPU User CPU System |
| | 205 | -------------------------------------------------------------- |
| | 206 | [...] |
| | 207 | Sending data 83.440086 73.408153 0.794420 |
| | 208 | [...] |
| | 209 | -------------------------------------------------------------- |
| | 210 | |
| | 211 | Bytes_sent 1.6 k |
| | 212 | Bytes_received 1.5 G |
| | 213 | }}} |
| | 214 | |
| | 215 | Now doing a full analysis for all six wobble positions |
| | 216 | |
| | 217 | {{{ |
| | 218 | #!/home/fact/FACT++/build/rootifysql --config=/home/fact/Analysis/crab.rc |
| | 219 | SELECT |
| | 220 | Events.*, |
| | 221 | Angle, |
| | 222 | weight, |
| | 223 | @PX := cosa*X - sina*Y, |
| | 224 | @PY := cosa*Y + sina*X, |
| | 225 | @DX := MeanX-@PX/1.02, |
| | 226 | @DY := MeanY-@PY/1.02, |
| | 227 | @Norm := SQRT(@DX*@DX + @DY*@DY), |
| | 228 | @Dist := @Norm*0.0117193246260285378 AS Dist, |
| | 229 | PI()*Width*Length*0.0117193246260285378*0.0117193246260285378 AS Area, |
| | 230 | @LX := TRUNCATE((CosDelta*@DY - SinDelta*@DX)/@Norm, 6), |
| | 231 | @LY := TRUNCATE((CosDelta*@DX + SinDelta*@DY)/@Norm, 6), |
| | 232 | @Alpha := ASIN(@LX) AS Alpha, |
| | 233 | @Sign := SIGN(@LY) AS Sign, |
| | 234 | @M3L := M3Long*@Sign*0.0117193246260285378, |
| | 235 | @Slope := SlopeLong*@Sign/0.0117193246260285378 AS Slope, |
| | 236 | @Xi := 1.39 + 0.154*@Slope + 1.679*(1-1/(1+4.86*Leakage1)), |
| | 237 | @Sign1 := @M3L+0.07, |
| | 238 | @Sign2 := (@Dist-0.5)*7.2-@Slope, |
| | 239 | @Disp := IF (SIGN(@Sign1)<0 || SIGN(@Sign2)<0, -@Xi, @Xi) * (1-Width/Length), |
| | 240 | @ThetaSq := (@Disp*@Disp + @Dist*@Dist - 2*@Disp*@Dist*SQRT(1-@LX*@LX)) AS ThetaSq |
| | 241 | FROM RunInfo |
| | 242 | LEFT JOIN Events USING (FileId) |
| | 243 | LEFT JOIN Position USING (FileId, EvtNumber) |
| | 244 | CROSS JOIN Wobble |
| | 245 | WHERE |
| | 246 | fSourceKey=5 |
| | 247 | AND |
| | 248 | fRunTypeKey=1 |
| | 249 | AND |
| | 250 | FileId BETWEEN 131101000 AND 131107000 |
| | 251 | AND |
| | 252 | fZenithDistanceMax<35 |
| | 253 | AND |
| | 254 | fR750Ref/fR750Cor>0.9 |
| | 255 | }}} |
| | 256 | |
| | 257 | Without writing a file and without filling the tree |
| | 258 | |
| | 259 | {{{ |
| | 260 | |
| | 261 | }}} |
| | 262 | |